Index: core/install.php =================================================================== --- core/install.php (revision 15111) +++ core/install.php (working copy) @@ -280,8 +280,8 @@ switch ($this->currentStep) { case 'sys_requirements': $required_checks = Array ( - 'php_version', 'curl', 'freetype', 'gd_version', - 'jpeg', 'mysql', 'date.timezone', 'output_buffering', + 'php_version', 'curl', 'simplexml', 'freetype', 'gd_version', + 'jpeg', 'mysql', 'json', 'date.timezone', 'output_buffering', ); $check_results = $this->toolkit->CallPrerequisitesMethod('core/', 'CheckSystemRequirements'); @@ -673,7 +673,7 @@ case 'select_license': // reset memory cache, when application is first available (on fresh install and clean reinstall steps) - $this->Application->HandleEvent($event, 'adm:OnResetMemcache'); + $this->Application->HandleEvent(new kEvent('adm:OnResetMemcache')); $license_source = $this->GetVar('license_source'); switch ($license_source) { Index: core/install/install_toolkit.php =================================================================== --- core/install/install_toolkit.php (revision 15111) +++ core/install/install_toolkit.php (working copy) @@ -883,14 +883,14 @@ */ function deleteCache($refresh_permissions = false) { - $this->Application->HandleEvent($event, 'adm:OnResetConfigsCache'); - $this->Application->HandleEvent($event, 'adm:OnResetSections'); - $this->Application->HandleEvent($event, 'c:OnResetCMSMenuCache'); + $this->Application->HandleEvent(new kEvent('adm:OnResetConfigsCache')); + $this->Application->HandleEvent(new kEvent('adm:OnResetSections')); + $this->Application->HandleEvent(new kEvent('c:OnResetCMSMenuCache')); $this->Conn->Query('DELETE FROM ' . TABLE_PREFIX . 'CachedUrls'); - if ($refresh_permissions) { - if ($this->Application->ConfigValue('QuickCategoryPermissionRebuild')) { + if ( $refresh_permissions ) { + if ( $this->Application->ConfigValue('QuickCategoryPermissionRebuild') ) { // refresh permission without progress bar $updater =& $this->Application->makeClass('kPermCacheUpdater'); /* @var $updater kPermCacheUpdater */ @@ -968,7 +968,7 @@ */ function rebuildThemes() { - $this->Application->HandleEvent($themes_event, 'adm:OnRebuildThemes'); + $this->Application->HandleEvent(new kEvent('adm:OnRebuildThemes')); } /** Index: core/install/prerequisites.php =================================================================== --- core/install/prerequisites.php (revision 15111) +++ core/install/prerequisites.php (working copy) @@ -101,11 +101,11 @@ function CheckSystemRequirements() { $ret = Array (); - $ret['php_version'] = version_compare(PHP_VERSION, '5.2.0', '>='); - + $ret['php_version'] = version_compare(PHP_VERSION, '5.3.2', '>='); $ret['url_rewriting'] = function_exists('apache_get_modules') && in_array('mod_rewrite', apache_get_modules()); $ret['memcache'] = class_exists('Memcache'); $ret['curl'] = function_exists('curl_init'); + $ret['simplexml'] = function_exists('simplexml_load_string'); $ret['freetype'] = function_exists('imagettfbbox'); $ret['gd_version'] = $ret['jpeg'] = false; Index: core/install/step_templates/sys_requirements.tpl =================================================================== --- core/install/step_templates/sys_requirements.tpl (revision 15111) +++ core/install/step_templates/sys_requirements.tpl (working copy) @@ -11,17 +11,18 @@ '; $check_titles = Array ( - 'php_version' => 'PHP version: 5.2+ (required)', + 'php_version' => 'PHP version: 5.3.2+ (required)', 'url_rewriting' => 'URL Rewriting Support (optional)', 'java' => 'Java (optional)', 'sep1' => 'PHP extensions:', 'memcache' => '- Memcache (optional)', 'curl' => '- Curl (required)', + 'simplexml' => '- SimpleXML (required)', 'freetype' => '- Freetype (required)', 'gd_version' => '- GD 1.8+ (required)', 'jpeg' => '- jpeg (required)', 'mysql' => '- MySQL (required)', - 'json' => '- JSON (optional)', + 'json' => '- JSON (required)', 'sep2' => 'PHP settings:', 'memory_limit' => "- ini_set('memory_limit', ...) works (optional)", 'date.timezone' => "- ini_get('date.timezone') - timezone set (required)", @@ -33,7 +34,7 @@ $check_results = $this->toolkit->CallPrerequisitesMethod('core/', 'CheckSystemRequirements'); /*$required_checks = Array ( - 'php_version', 'curl', 'freetype', 'gd_version', + 'php_version', 'simplexml', 'curl', 'freetype', 'gd_version', 'jpeg', 'mysql', 'date.timezone', 'output_buffering', ); Index: core/kernel/application.php =================================================================== --- core/kernel/application.php (revision 15129) +++ core/kernel/application.php (working copy) @@ -225,13 +225,15 @@ /** * Prevent kApplication class to be created directly, only via Instance method * - * @access protected + * @access private */ - protected function __construct() + private function __construct() { } + final private function __clone() {} + /** * Returns kApplication instance anywhere in the script. * @@ -263,7 +265,6 @@ if ( !$instance ) { $class = defined('APPLICATION_CLASS') ? APPLICATION_CLASS : 'kApplication'; $instance = new $class(); - $instance->Application =& $instance; } return $instance; @@ -272,13 +273,14 @@ /** * Initializes the Application * + * @param string $factory_class * @return bool Was Init actually made now or before * @access public * @see kHTTPQuery * @see Session * @see TemplatesCache */ - public function Init() + public function Init($factory_class = 'kFactory') { if ( $this->InitDone ) { return false; @@ -313,7 +315,7 @@ } } - $this->Factory = new kFactory(); + $this->Factory = new $factory_class(); $this->registerDefaultClasses(); $vars = kUtil::parseConfig(true); @@ -739,17 +741,17 @@ $this->registerClass('kMultipleFilter', KERNEL_PATH . '/utility/filters.php'); $this->registerClass('kiCacheable', KERNEL_PATH . '/interfaces/cacheable.php'); - $this->registerClass('kEventManager', KERNEL_PATH . '/event_manager.php', 'EventManager', 'kiCacheable'); - $this->registerClass('kHookManager', KERNEL_PATH . '/managers/hook_manager.php', null, 'kiCacheable'); - $this->registerClass('kScheduledTaskManager', KERNEL_PATH . '/managers/scheduled_task_manager.php', null, 'kiCacheable'); + $this->registerClass('kEventManager', KERNEL_PATH . '/event_manager.php', 'EventManager'); + $this->registerClass('kHookManager', KERNEL_PATH . '/managers/hook_manager.php'); + $this->registerClass('kScheduledTaskManager', KERNEL_PATH . '/managers/scheduled_task_manager.php'); $this->registerClass('kRequestManager', KERNEL_PATH . '/managers/request_manager.php'); $this->registerClass('kUrlManager', KERNEL_PATH . '/managers/url_manager.php'); $this->registerClass('kUrlProcessor', KERNEL_PATH . '/managers/url_processor.php'); - $this->registerClass('kPlainUrlProcessor', KERNEL_PATH . '/managers/plain_url_processor.php', null, 'kUrlProcessor'); - $this->registerClass('kRewriteUrlProcessor', KERNEL_PATH . '/managers/rewrite_url_processor.php', null, 'kUrlProcessor'); + $this->registerClass('kPlainUrlProcessor', KERNEL_PATH . '/managers/plain_url_processor.php'); + $this->registerClass('kRewriteUrlProcessor', KERNEL_PATH . '/managers/rewrite_url_processor.php'); - $this->registerClass('kCacheManager', KERNEL_PATH . '/managers/cache_manager.php', null, 'kiCacheable'); + $this->registerClass('kCacheManager', KERNEL_PATH . '/managers/cache_manager.php'); $this->registerClass('PhrasesCache', KERNEL_PATH . '/languages/phrases_cache.php', 'kPhraseCache'); $this->registerClass('kTempTablesHandler', KERNEL_PATH . '/utility/temp_handler.php'); $this->registerClass('kValidator', KERNEL_PATH . '/utility/validator.php'); @@ -762,7 +764,7 @@ $this->registerClass('Params', KERNEL_PATH . '/utility/params.php'); $this->registerClass('Params', KERNEL_PATH . '/utility/params.php', 'kActions'); $this->registerClass('kCache', KERNEL_PATH . '/utility/cache.php', 'kCache', 'Params'); - $this->registerClass('kHTTPQuery', KERNEL_PATH . '/utility/http_query.php', 'HTTPQuery', 'Params'); + $this->registerClass('kHTTPQuery', KERNEL_PATH . '/utility/http_query.php', 'HTTPQuery'); // session $this->registerClass('Session', KERNEL_PATH . '/session/session.php'); @@ -772,24 +774,24 @@ // template parser $this->registerClass('kTagProcessor', KERNEL_PATH . '/processors/tag_processor.php'); - $this->registerClass('kMainTagProcessor', KERNEL_PATH . '/processors/main_processor.php', 'm_TagProcessor', 'kTagProcessor'); - $this->registerClass('kDBTagProcessor', KERNEL_PATH . '/db/db_tag_processor.php', null, 'kTagProcessor'); - $this->registerClass('kCatDBTagProcessor', KERNEL_PATH . '/db/cat_tag_processor.php', null, 'kDBTagProcessor'); + $this->registerClass('kMainTagProcessor', KERNEL_PATH . '/processors/main_processor.php', 'm_TagProcessor'); + $this->registerClass('kDBTagProcessor', KERNEL_PATH . '/db/db_tag_processor.php'); + $this->registerClass('kCatDBTagProcessor', KERNEL_PATH . '/db/cat_tag_processor.php'); $this->registerClass('NParser', KERNEL_PATH . '/nparser/nparser.php'); - $this->registerClass('TemplatesCache', KERNEL_PATH . '/nparser/template_cache.php', null, Array ('kHelper', 'kDBTagProcessor')); + $this->registerClass('TemplatesCache', KERNEL_PATH . '/nparser/template_cache.php'); // database $this->registerClass('kDBConnection', KERNEL_PATH . '/db/db_connection.php'); $this->registerClass('kDBLoadBalancer', KERNEL_PATH . '/db/db_load_balancer.php'); $this->registerClass('kDBItem', KERNEL_PATH . '/db/dbitem.php'); - $this->registerClass('kCatDBItem', KERNEL_PATH . '/db/cat_dbitem.php', null, 'kDBItem'); + $this->registerClass('kCatDBItem', KERNEL_PATH . '/db/cat_dbitem.php'); $this->registerClass('kDBList', KERNEL_PATH . '/db/dblist.php'); - $this->registerClass('kCatDBList', KERNEL_PATH . '/db/cat_dblist.php', null, 'kDBList'); + $this->registerClass('kCatDBList', KERNEL_PATH . '/db/cat_dblist.php'); $this->registerClass('kDBEventHandler', KERNEL_PATH . '/db/db_event_handler.php'); - $this->registerClass('kCatDBEventHandler', KERNEL_PATH . '/db/cat_event_handler.php', null, 'kDBEventHandler'); + $this->registerClass('kCatDBEventHandler', KERNEL_PATH . '/db/cat_event_handler.php'); // email sending - $this->registerClass('kEmailSendingHelper', KERNEL_PATH . '/utility/email_send.php', 'EmailSender', 'kHelper'); + $this->registerClass('kEmailSendingHelper', KERNEL_PATH . '/utility/email_send.php', 'EmailSender'); $this->registerClass('kSocket', KERNEL_PATH . '/utility/socket.php', 'Socket'); // do not move to config - this helper is used before configs are read @@ -2013,7 +2015,7 @@ * @param Array $specific_params * @access public */ - public function HandleEvent(&$event, $params = null, $specific_params = null) + public function HandleEvent($event, $params = null, $specific_params = null) { if ( isset($params) ) { $event = new kEvent($params, $specific_params); @@ -2028,13 +2030,12 @@ * @param string $real_class Real name of class as in class declaration * @param string $file Filename in what $real_class is declared * @param string $pseudo_class Name under this class object will be accessed using getObject method - * @param Array $dependencies List of classes required for this class functioning * @return void * @access public */ - public function registerClass($real_class, $file, $pseudo_class = null, $dependencies = Array() ) + public function registerClass($real_class, $file, $pseudo_class = null) { - $this->Factory->registerClass($real_class, $file, $pseudo_class, $dependencies); + $this->Factory->registerClass($real_class, $file, $pseudo_class); } /** @@ -2051,20 +2052,6 @@ } /** - * Add $class_name to required classes list for $depended_class class. - * All required class files are included before $depended_class file is included - * - * @param string $depended_class - * @param string $class_name - * @return void - * @access public - */ - public function registerDependency($depended_class, $class_name) - { - $this->Factory->registerDependency($depended_class, $class_name); - } - - /** * Add new scheduled task * * @param string $short_name name to be used to store last maintenance run info @@ -2172,7 +2159,7 @@ */ public function hasObject($name) { - return isset($this->Factory->Storage[$name]); + return $this->Factory->hasObject($name); } /** @@ -2666,7 +2653,8 @@ $event_str = 'emailevents:OnEmailEvent'; } - $this->HandleEvent($event, $event_str, $params); + $event = new kEvent($event_str, $params); + $this->HandleEvent($event); return $event; } Index: core/kernel/db/cat_event_handler.php =================================================================== --- core/kernel/db/cat_event_handler.php (revision 15111) +++ core/kernel/db/cat_event_handler.php (working copy) @@ -51,7 +51,7 @@ * @return void * @access protected */ - protected function LoadItem(kEvent &$event) + protected function LoadItem(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -82,7 +82,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( !$this->Application->isAdmin ) { if ( $event->Name == 'OnSetSortingDirect' ) { @@ -164,7 +164,7 @@ * @param kEvent $event * @return string */ - function _getPermissionCheckIDs(&$event) + function _getPermissionCheckIDs($event) { if ($event->Name == 'OnSave') { $selected_ids = implode(',', $this->getSelectedIDs($event, true)); @@ -186,7 +186,7 @@ * @param kEvent $event * @return Array */ - function _getPermissionCheckInfo(&$event) + function _getPermissionCheckInfo($event) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ @@ -223,7 +223,7 @@ * @return void * @access protected */ - protected function OnCopy(&$event) + protected function OnCopy($event) { $this->Application->RemoveVar('clipboard'); @@ -241,7 +241,7 @@ * @return void * @access protected */ - protected function OnCut(&$event) + protected function OnCut($event) { $this->Application->RemoveVar('clipboard'); $clipboard_helper =& $this->Application->recallObject('ClipboardHelper'); @@ -257,7 +257,7 @@ * @param kEvent $event * @return bool */ - function _checkPastePermission(&$event) + function _checkPastePermission($event) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ @@ -278,7 +278,7 @@ * @return void * @access protected */ - protected function OnPaste(&$event) + protected function OnPaste($event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) || !$this->_checkPastePermission($event) ) { $event->status = kEvent::erFAIL; @@ -319,7 +319,7 @@ * @return void * @access protected */ - protected function OnMassDelete(kEvent &$event) + protected function OnMassDelete(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -375,7 +375,7 @@ * @param kEvent $event * @return Array */ - function getTypeClauses(&$event) + function getTypeClauses($event) { $types = $event->getEventParam('types'); $types = $types ? explode(',', $types) : Array (); @@ -591,7 +591,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -747,7 +747,7 @@ * @return void * @access protected */ - protected function prepareObject(&$object, kEvent &$event) + protected function prepareObject(&$object, kEvent $event) { $this->prepareItemStatuses($event); $object->addCalculatedField('CachedNavbar', 'l' . $this->Application->GetVar('m_lang') . '_CachedNavbar'); @@ -765,7 +765,7 @@ * * @param kEvent $event */ - function prepareItemStatuses(&$event) + function prepareItemStatuses($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); @@ -818,7 +818,7 @@ * @return float * @access protected */ - protected function CalculateHotLimit(&$event) + protected function CalculateHotLimit($event) { $property_map = $this->Application->getUnitOption($event->Prefix, 'ItemPropertyMappings'); @@ -854,7 +854,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -891,7 +891,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -962,7 +962,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -1022,7 +1022,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -1085,7 +1085,7 @@ * * @param kEvent $event */ - function OnSimpleSearch(&$event) + function OnSimpleSearch($event) { $event->redirect = false; $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; @@ -1362,7 +1362,7 @@ * * @param kEvent $event */ - function OnSubSearch(&$event) + function OnSubSearch($event) { $ids = Array (); $search_table = TABLE_PREFIX . 'ses_' . $this->Application->GetSID() . '_' . TABLE_PREFIX . 'Search'; @@ -1384,7 +1384,7 @@ * @param kEvent $event * @todo Change all hardcoded Products table & In-Commerce module usage to dynamic usage from item config !!! */ - function OnAdvancedSearch(&$event) + function OnAdvancedSearch($event) { $query_object =& $this->Application->recallObject('HTTPQuery'); /* @var $query_object kHTTPQuery */ @@ -1813,7 +1813,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetPagination(kEvent &$event) + protected function SetPagination(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBList */ @@ -1888,7 +1888,7 @@ * @return void * @access protected */ - protected function OnExport(kEvent &$event) + protected function OnExport(kEvent $event) { $selected_ids = $this->StoreSelectedIDs($event); if ( implode(',', $selected_ids) == '' ) { @@ -1917,7 +1917,7 @@ * * @param kEvent $event */ - function OnExportProgress(&$event) + function OnExportProgress($event) { $export_object =& $this->Application->recallObject('CatItemExportHelper'); /* @var $export_object kCatDBItemExportHelper */ @@ -1958,7 +1958,7 @@ * @return Array * @access protected */ - public function getCustomExportColumns(kEvent &$event) + public function getCustomExportColumns(kEvent $event) { return Array ( '__VIRTUAL__ThumbnailImage' => 'ThumbnailImage', @@ -1972,7 +1972,7 @@ * * @param kEvent $event */ - function setCustomExportColumns(&$event) + function setCustomExportColumns($event) { $this->restorePrimaryImage($event); } @@ -1984,7 +1984,7 @@ * @return void * @access protected */ - protected function restorePrimaryImage(&$event) + protected function restorePrimaryImage($event) { $object =& $event->getObject(); /* @var $object kCatDBItem */ @@ -2054,7 +2054,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); @@ -2071,7 +2071,7 @@ * * @param kEvent $event */ - function OnProcessSelected(&$event) + function OnProcessSelected($event) { $dst_field = $this->Application->RecallVar('dst_field'); $selected_ids = $this->Application->GetVar('selected_ids'); @@ -2103,7 +2103,7 @@ * * @param kEvent $event */ - function OnSaveSettings(&$event) + function OnSaveSettings($event) { $event->redirect = false; $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); @@ -2129,7 +2129,7 @@ * * @param kEvent $event */ - function OnResetSettings(&$event) + function OnResetSettings($event) { $this->Application->StoreVar('ImportCategory', $this->Application->getBaseCategory()); } @@ -2140,7 +2140,7 @@ * @return void * @todo Used? */ - function OnCancelAction(&$event) + function OnCancelAction($event) { $event->redirect = $this->Application->GetVar('cancel_template'); $event->SetRedirectParam('pass', 'all,' . $event->getPrefixSpecial()); @@ -2155,7 +2155,7 @@ * @param string $id_field * @param string $cached_field */ - function cacheItemOwner(&$event, $id_field, $cached_field) + function cacheItemOwner($event, $id_field, $cached_field) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2185,7 +2185,7 @@ * @return void * @access protected */ - protected function OnPreSave(kEvent &$event) + protected function OnPreSave(kEvent $event) { parent::OnPreSave($event); @@ -2259,7 +2259,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -2281,7 +2281,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteOriginal(kEvent &$event) + protected function OnBeforeDeleteOriginal(kEvent $event) { } @@ -2293,7 +2293,7 @@ * @return void * @access protected */ - protected function OnAfterDeleteOriginal(kEvent &$event) + protected function OnAfterDeleteOriginal(kEvent $event) { } @@ -2306,7 +2306,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(kEvent &$event) + protected function OnBeforeClone(kEvent $event) { parent::OnBeforeClone($event); @@ -2327,7 +2327,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -2352,7 +2352,7 @@ * * @param kEvent $event */ - function setItemStatusByPermission(&$event) + function setItemStatusByPermission($event) { $use_pending_editing = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing'); @@ -2384,7 +2384,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { parent::OnCreate($event); @@ -2456,7 +2456,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { $use_pending = $this->Application->getUnitOption($event->Prefix, 'UsePendingEditing'); if ($this->Application->isAdminUser || !$use_pending) { @@ -2549,7 +2549,7 @@ * @param kEvent $event * @param string $template_key - {suggest,modify} */ - function SetFrontRedirectTemplate(&$event, $template_key) + function SetFrontRedirectTemplate($event, $template_key) { if ( $this->Application->isAdmin || $event->status != kEvent::erSUCCESS ) { return; @@ -2593,7 +2593,7 @@ * @return void * @access protected */ - protected function iterateItems(kEvent &$event) + protected function iterateItems(kEvent $event) { if ( $event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline' ) { parent::iterateItems($event); @@ -2642,7 +2642,7 @@ * @return void * @access protected */ - protected function OnDelete(kEvent &$event) + protected function OnDelete(kEvent $event) { parent::OnDelete($event); @@ -2659,7 +2659,7 @@ * @return bool * @access protected */ - protected function checkItemStatus(kEvent &$event) + protected function checkItemStatus(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2691,7 +2691,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetSorting(kEvent &$event) + protected function SetSorting(kEvent $event) { if ( !$this->Application->isAdmin ) { $event->setEventParam('same_special', true); @@ -2707,7 +2707,7 @@ * @return int * @access protected */ - protected function getPerPage(kEvent &$event) + protected function getPerPage(kEvent $event) { if ( !$this->Application->isAdmin ) { $event->setEventParam('same_special', true); @@ -2735,7 +2735,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -2775,7 +2775,7 @@ $this->Application->setUnitOption($event->Prefix, 'VirtualFields', $virtual_fields); } - function changeSortings(&$event) + function changeSortings($event) { $remove_sortings = Array (); @@ -2813,7 +2813,7 @@ * * @param kEvent $event */ - function OnDownloadFile(&$event) + function OnDownloadFile($event) { $object =& $event->getObject(); /* @var $object kCatDBItem */ @@ -2837,7 +2837,7 @@ * * @param kEvent $event */ - function OnMakeVote(&$event) + function OnMakeVote($event) { $event->status = kEvent::erSTOP; @@ -2864,7 +2864,7 @@ * @return void * @access protected */ - protected function OnReviewHelpful(&$event) + protected function OnReviewHelpful($event) { if ( $this->Application->GetVar('ajax') == 'yes' ) { $event->status = kEvent::erSTOP; @@ -2917,7 +2917,7 @@ * @return void * @access protected */ - protected function OnCloneSubItem(kEvent &$event) + protected function OnCloneSubItem(kEvent $event) { parent::OnCloneSubItem($event); @@ -2939,7 +2939,7 @@ * @return void * @access protected */ - protected function OnAfterItemValidate(kEvent &$event) + protected function OnAfterItemValidate(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ Index: core/kernel/db/db_event_handler.php =================================================================== --- core/kernel/db/db_event_handler.php (revision 15121) +++ core/kernel/db/db_event_handler.php (working copy) @@ -51,7 +51,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $section = $event->getSection(); @@ -211,7 +211,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->getEventParam('raise_warnings') === false ) { $event->setEventParam('raise_warnings', 1); @@ -281,7 +281,7 @@ * @return Array * @access protected */ - protected function StoreSelectedIDs(kEvent &$event, $direct_ids = null) + protected function StoreSelectedIDs(kEvent $event, $direct_ids = null) { $wid = $this->Application->GetTopmostWid($event->Prefix); $session_name = rtrim($event->getPrefixSpecial() . '_selected_ids_' . $wid, '_'); @@ -351,7 +351,7 @@ * @return Array * @access protected */ - protected function getSelectedIDs(kEvent &$event, $from_session = false) + protected function getSelectedIDs(kEvent $event, $from_session = false) { if ( $from_session ) { $wid = $this->Application->GetTopmostWid($event->Prefix); @@ -372,7 +372,7 @@ * @return void * @access protected */ - protected function OnStoreSelected(kEvent &$event) + protected function OnStoreSelected(kEvent $event) { $this->StoreSelectedIDs($event); @@ -393,7 +393,7 @@ * @return Array * @access protected */ - protected function getSubmittedFields(kEvent &$event) + protected function getSubmittedFields(kEvent $event) { $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); $field_values = $items_info ? array_shift($items_info) : Array (); @@ -432,7 +432,7 @@ * @return void * @access protected */ - protected function clearSelectedIDs(kEvent &$event) + protected function clearSelectedIDs(kEvent $event) { $prefix_special = $event->getPrefixSpecial(); @@ -456,7 +456,7 @@ * @return void * @access protected */ - protected function dbBuild(&$object, kEvent &$event) + protected function dbBuild(&$object, kEvent $event) { // for permission checking inside item/list build events $event->setEventParam('top_prefix', $this->Application->GetTopmostPrefix($event->Prefix, true)); @@ -498,7 +498,7 @@ * @return bool * @access protected */ - protected function checkItemStatus(kEvent &$event) + protected function checkItemStatus(kEvent $event) { $status_fields = $this->Application->getUnitOption($event->Prefix, 'StatusField'); if ( !$status_fields ) { @@ -528,7 +528,7 @@ * @return void * @access protected */ - protected function _errorNotFound(kEvent &$event) + protected function _errorNotFound(kEvent $event) { if ( $event->getEventParam('raise_warnings') === 0 ) { // when it's possible, that autoload fails do nothing @@ -561,7 +561,7 @@ * @param kEvent $event * @access protected */ - protected function OnItemBuild(kEvent &$event) + protected function OnItemBuild(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -640,7 +640,7 @@ * @return void * @access protected */ - protected function OnTempHandlerBuild(kEvent &$event) + protected function OnTempHandlerBuild(kEvent $event) { $object =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler'); /* @var $object kTempTablesHandler */ @@ -661,7 +661,7 @@ * @return bool * @access protected */ - protected function UseTempTables(kEvent &$event) + protected function UseTempTables(kEvent $event) { $top_prefix = $this->Application->GetTopmostPrefix($event->Prefix); // passed parent, not always actual $special = ($top_prefix == $event->Prefix) ? $event->Special : $this->getMainSpecial($event); @@ -676,7 +676,7 @@ * @return void * @access protected */ - protected function LoadItem(kEvent &$event) + protected function LoadItem(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -707,7 +707,7 @@ * @param kEvent $event * @access protected */ - protected function OnListBuild(kEvent &$event) + protected function OnListBuild(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBList */ @@ -758,7 +758,7 @@ * @return string * @access protected */ - protected function getMainSpecial(kEvent &$event) + protected function getMainSpecial(kEvent $event) { $main_special = $event->getEventParam('main_special'); @@ -785,7 +785,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { } @@ -797,7 +797,7 @@ * @return void * @access protected */ - protected function OnSetPerPage(kEvent &$event) + protected function OnSetPerPage(kEvent $event) { $per_page = $this->Application->GetVar($event->getPrefixSpecial(true) . '_PerPage'); $event->SetRedirectParam($event->getPrefixSpecial() . '_PerPage', $per_page); @@ -818,7 +818,7 @@ * @return void * @access protected */ - protected function OnSetPage(kEvent &$event) + protected function OnSetPage(kEvent $event) { $page = $this->Application->GetVar($event->getPrefixSpecial(true) . '_Page'); $event->SetRedirectParam($event->getPrefixSpecial() . '_Page', $page); @@ -837,7 +837,7 @@ * @return void * @access protected */ - protected function _passListParams(&$event, $skip_var) + protected function _passListParams($event, $skip_var) { $param_names = array_diff(Array ('page', 'per_page', 'sort_by'), Array ($skip_var)); @@ -883,7 +883,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetPagination(kEvent &$event) + protected function SetPagination(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBList */ @@ -940,7 +940,7 @@ * @return int * @access protected */ - protected function getPerPage(kEvent &$event) + protected function getPerPage(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBList */ @@ -1024,7 +1024,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetSorting(kEvent &$event) + protected function SetSorting(kEvent $event) { $event->setPseudoClass('_List'); @@ -1124,7 +1124,7 @@ * @return string|Array * @access protected */ - protected function getListSetting(kEvent &$event, $variable_name) + protected function getListSetting(kEvent $event, $variable_name) { $view_name = $this->Application->RecallVar($event->getPrefixSpecial() . '_current_view'); $storage_prefix = $event->getEventParam('same_special') ? $event->Prefix : $event->getPrefixSpecial(); @@ -1153,7 +1153,7 @@ * @return void * @access protected */ - protected function setListSetting(kEvent &$event, $variable_name, $variable_value = null) + protected function setListSetting(kEvent $event, $variable_name, $variable_value = null) { $view_name = $this->Application->RecallVar($event->getPrefixSpecial() . '_current_view'); // $this->Application->StoreVar($event->getPrefixSpecial() . '_' . $variable_name, $variable_value, true); //true for optional @@ -1177,7 +1177,7 @@ * @return void * @access protected */ - protected function AddFilters(kEvent &$event) + protected function AddFilters(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBList */ @@ -1264,7 +1264,7 @@ * @return void * @access protected */ - protected function applyItemFilters(&$event) + protected function applyItemFilters($event) { $filter_values = $this->Application->GetVar('filters', Array ()); @@ -1330,7 +1330,7 @@ * @return void * @access protected */ - protected function OnSetSorting(kEvent &$event) + protected function OnSetSorting(kEvent $event) { $sorting_settings = $this->getListSetting($event, 'Sortings'); $cur_sort1 = getArrayValue($sorting_settings, 'Sort1'); @@ -1374,7 +1374,7 @@ * @return void * @access protected */ - protected function OnSetSortingDirect(kEvent &$event) + protected function OnSetSortingDirect(kEvent $event) { // used on Front-End in category item lists $prefix_special = $event->getPrefixSpecial(); @@ -1421,7 +1421,7 @@ * @return void * @access protected */ - protected function OnResetSorting(kEvent &$event) + protected function OnResetSorting(kEvent $event) { $this->setListSetting($event, 'Sortings'); } @@ -1433,7 +1433,7 @@ * @return void * @access protected */ - protected function OnSetAutoRefreshInterval(kEvent &$event) + protected function OnSetAutoRefreshInterval(kEvent $event) { $refresh_interval = $this->Application->GetVar('refresh_interval'); @@ -1448,7 +1448,7 @@ * @return void * @access protected */ - protected function OnAutoRefreshToggle(kEvent &$event) + protected function OnAutoRefreshToggle(kEvent $event) { $refresh_intervals = $this->Application->ConfigValue('AutoRefreshIntervals'); if ( !$refresh_intervals ) { @@ -1475,7 +1475,7 @@ * @return string * @access protected */ - protected function ItemPrepareQuery(kEvent &$event) + protected function ItemPrepareQuery(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1498,7 +1498,7 @@ * @return string * @access protected */ - protected function ListPrepareQuery(kEvent &$event) + protected function ListPrepareQuery(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1516,7 +1516,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { } @@ -1530,7 +1530,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -1566,7 +1566,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -1585,7 +1585,7 @@ * @return void * @access protected */ - protected function _update(kEvent &$event) + protected function _update(kEvent $event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -1618,14 +1618,14 @@ * @return void * @access protected */ - protected function OnDelete(kEvent &$event) + protected function OnDelete(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; return; } - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $temp_handler->DeleteItems($event->Prefix, $event->Special, Array ($this->getPassedID($event))); @@ -1638,14 +1638,14 @@ * @return void * @access protected */ - protected function OnDeleteAll(kEvent &$event) + protected function OnDeleteAll(kEvent $event) { $sql = 'SELECT ' . $this->Application->getUnitOption($event->Prefix, 'IDField') . ' FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName'); $ids = $this->Conn->GetCol($sql); if ( $ids ) { - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $temp_handler->DeleteItems($event->Prefix, $event->Special, $ids); @@ -1659,7 +1659,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -1687,7 +1687,7 @@ * @return void * @access protected */ - protected function OnCancel(kEvent &$event) + protected function OnCancel(kEvent $event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -1697,7 +1697,7 @@ if ( $items_info ) { $delete_ids = Array (); - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ foreach ($items_info as $id => $field_values) { @@ -1725,14 +1725,14 @@ * @return void * @access protected */ - protected function OnMassDelete(kEvent &$event) + protected function OnMassDelete(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; return ; } - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $ids = $this->StoreSelectedIDs($event); @@ -1755,7 +1755,7 @@ * @return void * @access protected */ - protected function setTempWindowID(kEvent &$event) + protected function setTempWindowID(kEvent $event) { $prefixes = Array ($event->Prefix, $event->getPrefixSpecial(true)); @@ -1778,7 +1778,7 @@ * @return void * @access protected */ - protected function OnEdit(kEvent &$event) + protected function OnEdit(kEvent $event) { $this->setTempWindowID($event); $ids = $this->StoreSelectedIDs($event); @@ -1788,7 +1788,7 @@ $changes_var_name = $this->Prefix . '_changes_' . $this->Application->GetTopmostWid($this->Prefix); $this->Application->RemoveVar($changes_var_name); - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $temp_handler->PrepareEdit(); @@ -1806,7 +1806,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { $event->CallSubEvent('OnPreSave'); @@ -1815,7 +1815,7 @@ } $skip_master = false; - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $changes_var_name = $this->Prefix . '_changes_' . $this->Application->GetTopmostWid($this->Prefix); @@ -1959,9 +1959,9 @@ * @return void * @access protected */ - protected function OnCancelEdit(kEvent &$event) + protected function OnCancelEdit(kEvent $event) { - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $temp_handler->CancelEdit(); @@ -1982,7 +1982,7 @@ * @return bool * @access public */ - public function isNewItemCreate(kEvent &$event) + public function isNewItemCreate(kEvent $event) { $object =& $event->getObject( Array ('raise_warnings' => 0) ); /* @var $object kDBItem */ @@ -1998,7 +1998,7 @@ * @return void * @access protected */ - protected function OnPreSave(kEvent &$event) + protected function OnPreSave(kEvent $event) { // if there is no id - it means we need to create an item if ( is_object($event->MasterEvent) ) { @@ -2026,7 +2026,7 @@ * @return void * @access protected */ - protected function OnPreSaveSubItem(kEvent &$event) + protected function OnPreSaveSubItem(kEvent $event) { $not_created = $this->isNewItemCreate($event); @@ -2053,7 +2053,7 @@ * @return void * @access protected */ - protected function OnPreSaveAndGo(kEvent &$event) + protected function OnPreSaveAndGo(kEvent $event) { $event->CallSubEvent('OnPreSave'); @@ -2071,7 +2071,7 @@ * @return void * @access protected */ - protected function OnPreSaveAndGoToTab(kEvent &$event) + protected function OnPreSaveAndGoToTab(kEvent $event) { $event->CallSubEvent('OnPreSave'); @@ -2088,7 +2088,7 @@ * @return void * @access protected */ - protected function OnUpdateAndGoToTab(kEvent &$event) + protected function OnUpdateAndGoToTab(kEvent $event) { $event->setPseudoClass('_List'); $event->CallSubEvent('OnUpdate'); @@ -2107,7 +2107,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { $this->setTempWindowID($event); $this->clearSelectedIDs($event); @@ -2116,7 +2116,7 @@ $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ - $temp_handler =& $this->Application->recallObject($event->Prefix . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->Prefix . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $temp_handler->PrepareEdit(); @@ -2139,7 +2139,7 @@ * @return void * @access protected */ - protected function OnPreSaveCreated(kEvent &$event) + protected function OnPreSaveCreated(kEvent $event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -2167,7 +2167,7 @@ * @return void * @access protected */ - protected function OnReset(kEvent &$event) + protected function OnReset(kEvent $event) { //do nothing - should reset :) if ( $this->isNewItemCreate($event) ) { @@ -2187,7 +2187,7 @@ * @return void * @access protected */ - protected function iterateItems(kEvent &$event) + protected function iterateItems(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -2249,14 +2249,14 @@ * @return void * @access protected */ - protected function OnMassClone(kEvent &$event) + protected function OnMassClone(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; return; } - $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => &$event)); + $temp_handler =& $this->Application->recallObject($event->getPrefixSpecial() . '_TempHandler', 'kTempTablesHandler', Array ('parent_event' => $event)); /* @var $temp_handler kTempTablesHandler */ $ids = $this->StoreSelectedIDs($event); @@ -2295,7 +2295,7 @@ * @return void * @access protected */ - protected function OnPreSavePopup(kEvent &$event) + protected function OnPreSavePopup(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2319,7 +2319,7 @@ * @return void * @access protected */ - protected function OnBeforeItemLoad(kEvent &$event) + protected function OnBeforeItemLoad(kEvent $event) { } @@ -2332,7 +2332,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { } @@ -2344,7 +2344,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { } @@ -2356,7 +2356,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2373,7 +2373,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { } @@ -2385,7 +2385,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2403,7 +2403,7 @@ * @return void * @access protected */ - protected function OnBeforeItemDelete(kEvent &$event) + protected function OnBeforeItemDelete(kEvent $event) { } @@ -2416,7 +2416,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { } @@ -2428,7 +2428,7 @@ * @return void * @access protected */ - protected function OnBeforeItemValidate(kEvent &$event) + protected function OnBeforeItemValidate(kEvent $event) { } @@ -2440,7 +2440,7 @@ * @return void * @access protected */ - protected function OnAfterItemValidate(kEvent &$event) + protected function OnAfterItemValidate(kEvent $event) { } @@ -2453,7 +2453,7 @@ * @return void * @access protected */ - protected function OnAfterCopyToTemp(kEvent &$event) + protected function OnAfterCopyToTemp(kEvent $event) { } @@ -2467,7 +2467,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteFromLive(kEvent &$event) + protected function OnBeforeDeleteFromLive(kEvent $event) { } @@ -2480,7 +2480,7 @@ * @return void * @access protected */ - protected function OnBeforeCopyToLive(kEvent &$event) + protected function OnBeforeCopyToLive(kEvent $event) { } @@ -2493,7 +2493,7 @@ * @return void * @access protected */ - protected function OnAfterCopyToLive(kEvent &$event) + protected function OnAfterCopyToLive(kEvent $event) { $this->_proccessPendingActions($event); } @@ -2505,7 +2505,7 @@ * @return void * @access protected */ - protected function _proccessPendingActions(kEvent &$event) + protected function _proccessPendingActions(kEvent $event) { $var_name = $this->_getPendingActionVariableName($event); $schedule = $this->Application->RecallVar($var_name); @@ -2530,7 +2530,7 @@ * @return string * @access protected */ - protected function _getPendingActionVariableName(kEvent &$event) + protected function _getPendingActionVariableName(kEvent $event) { $window_id = $this->Application->GetTopmostWid($event->Prefix); @@ -2545,7 +2545,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(kEvent &$event) + protected function OnBeforeClone(kEvent $event) { } @@ -2558,7 +2558,7 @@ * @return void * @access protected */ - protected function OnAfterClone(kEvent &$event) + protected function OnAfterClone(kEvent $event) { } @@ -2570,7 +2570,7 @@ * @return void * @access protected */ - protected function OnAfterListQuery(kEvent &$event) + protected function OnAfterListQuery(kEvent $event) { } @@ -2585,7 +2585,7 @@ * @access protected * @deprecated */ - protected function finalizePopup(kEvent &$event) + protected function finalizePopup(kEvent $event) { $event->SetRedirectParam('opener', 'u'); } @@ -2597,7 +2597,7 @@ * @return void * @access protected */ - protected function OnSearch(kEvent &$event) + protected function OnSearch(kEvent $event) { $event->setPseudoClass('_List'); @@ -2614,7 +2614,7 @@ * @return void * @access protected */ - protected function OnSearchReset(kEvent &$event) + protected function OnSearchReset(kEvent $event) { $search_helper =& $this->Application->recallObject('SearchHelper'); /* @var $search_helper kSearchHelper */ @@ -2630,7 +2630,7 @@ * @access protected * @deprecated */ - protected function OnSetFilter(kEvent &$event) + protected function OnSetFilter(kEvent $event) { $filter_id = $this->Application->GetVar('filter_id'); $filter_value = $this->Application->GetVar('filter_value'); @@ -2650,7 +2650,7 @@ * @return void * @access protected */ - protected function OnSetFilterPattern(kEvent &$event) + protected function OnSetFilterPattern(kEvent $event) { $filters = $this->Application->GetVar($event->getPrefixSpecial(true) . '_filters'); if ( !$filters ) { @@ -2678,7 +2678,7 @@ * @return void * @access protected */ - protected function FilterAction(kEvent &$event) + protected function FilterAction(kEvent $event) { $view_filter = Array (); $filter_menu = $this->Application->getUnitOption($event->Prefix, 'FilterMenu'); @@ -2714,7 +2714,7 @@ * @param kEvent $event * @access protected */ - protected function OnPreSaveAndOpenTranslator(kEvent &$event) + protected function OnPreSaveAndOpenTranslator(kEvent $event) { $this->Application->SetVar('allow_translation', true); @@ -2790,7 +2790,7 @@ * @return void * @access protected */ - protected function OnSelectUser(kEvent &$event) + protected function OnSelectUser(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2835,7 +2835,7 @@ * @return void * @access protected */ - protected function OnExport(kEvent &$event) + protected function OnExport(kEvent $event) { $selected_ids = $this->StoreSelectedIDs($event); @@ -2874,7 +2874,7 @@ * @return void * @access protected */ - protected function prepareObject(&$object, kEvent &$event) + protected function prepareObject(&$object, kEvent $event) { if ( $event->Special == 'export' || $event->Special == 'import' ) { $export_helper =& $this->Application->recallObject('CatItemExportHelper'); @@ -2891,7 +2891,7 @@ * @return Array * @access public */ - public function getCustomExportColumns(kEvent &$event) + public function getCustomExportColumns(kEvent $event) { return Array(); } @@ -2903,7 +2903,7 @@ * @return void * @access protected */ - protected function OnExportBegin(kEvent &$event) + protected function OnExportBegin(kEvent $event) { $export_helper =& $this->Application->recallObject('CatItemExportHelper'); /* @var $export_helper kCatDBItemExportHelper */ @@ -2918,7 +2918,7 @@ * @return void * @access protected */ - protected function OnExportCancel(kEvent &$event) + protected function OnExportCancel(kEvent $event) { $this->OnGoBack($event); } @@ -2930,7 +2930,7 @@ * @return void * @access protected */ - protected function OnBeforeExportBegin(kEvent &$event) + protected function OnBeforeExportBegin(kEvent $event) { } @@ -2942,7 +2942,7 @@ * @return void * @access protected */ - protected function OnDeleteExportPreset(kEvent &$event) + protected function OnDeleteExportPreset(kEvent $event) { $field_values = $this->getSubmittedFields($event); @@ -2985,7 +2985,7 @@ * @return void * @access protected */ - protected function OnPreSaveAndChangeLanguage(kEvent &$event) + protected function OnPreSaveAndChangeLanguage(kEvent $event) { if ( $this->UseTempTables($event) ) { $event->CallSubEvent('OnPreSave'); @@ -3009,7 +3009,7 @@ * @return void * @access protected */ - protected function OnUploadFile(kEvent &$event) + protected function OnUploadFile(kEvent $event) { $event->status = kEvent::erSTOP; // define('DBG_SKIP_REPORTING', 0); @@ -3113,7 +3113,7 @@ * @param kEvent $event * @return bool */ - protected function _checkFlashUploaderPermission(kEvent &$event) + protected function _checkFlashUploaderPermission(kEvent $event) { // Flash uploader does NOT send correct cookies, so we need to make our own check $cookie_name = 'adm_' . $this->Application->ConfigValue('SessionCookieName'); @@ -3156,7 +3156,7 @@ * @return void * @access protected */ - protected function OnDeleteFile(kEvent &$event) + protected function OnDeleteFile(kEvent $event) { $event->status = kEvent::erSTOP; @@ -3181,7 +3181,7 @@ * @return void * @access protected */ - protected function OnViewFile(kEvent &$event) + protected function OnViewFile(kEvent $event) { $event->status = kEvent::erSTOP; @@ -3240,7 +3240,7 @@ * @return void * @access protected */ - protected function OnValidateMInputFields(kEvent &$event) + protected function OnValidateMInputFields(kEvent $event) { $minput_helper =& $this->Application->recallObject('MInputHelper'); /* @var $minput_helper MInputHelper */ @@ -3255,7 +3255,7 @@ * @return void * @access protected */ - protected function OnValidateField(kEvent &$event) + protected function OnValidateField(kEvent $event) { $event->status = kEvent::erSTOP; $field = $this->Application->GetVar('field'); @@ -3305,7 +3305,7 @@ * @return void * @access protected */ - protected function OnSuggestValues(kEvent &$event) + protected function OnSuggestValues(kEvent $event) { if ( !$this->Application->isAdminUser ) { // very careful here, because this event allows to @@ -3355,7 +3355,7 @@ * @return void * @access protected */ - protected function OnSaveWidths(kEvent &$event) + protected function OnSaveWidths(kEvent $event) { $event->status = kEvent::erSTOP; @@ -3383,7 +3383,7 @@ * @return void * @access protected */ - protected function OnBeforeCSVLineImport(kEvent &$event) + protected function OnBeforeCSVLineImport(kEvent $event) { // abstract, for hooking } @@ -3395,7 +3395,7 @@ * @return void * @access protected */ - protected function OnCloneSubItem(kEvent &$event) + protected function OnCloneSubItem(kEvent $event) { $clones = $this->Application->getUnitOption($event->MasterEvent->Prefix, 'Clones'); @@ -3412,7 +3412,7 @@ * @see PriorityEventHandler * @access protected */ - protected function OnGetConstrainInfo(kEvent &$event) + protected function OnGetConstrainInfo(kEvent $event) { $event->setEventParam('constrain_info', Array ('', '')); } Index: core/kernel/db/dbitem.php =================================================================== --- core/kernel/db/dbitem.php (revision 15111) +++ core/kernel/db/dbitem.php (working copy) @@ -944,18 +944,13 @@ protected function raiseEvent($name, $id = null, $additional_params = Array()) { - $event = new kEvent( $this->getPrefixSpecial() . ':' . $name ); + $additional_params['id'] = isset($id) ? $id : $this->GetID(); + $event = new kEvent($this->getPrefixSpecial() . ':' . $name, $additional_params); if ( is_object($this->parentEvent) ) { $event->MasterEvent =& $this->parentEvent; } - $additional_params['id'] = isset($id) ? $id : $this->GetID(); - - foreach ($additional_params as $ap_name => $ap_value) { - $event->setEventParam($ap_name, $ap_value); - } - $this->Application->HandleEvent($event); return $event->status == kEvent::erSUCCESS; Index: core/kernel/db/dblist.php =================================================================== --- core/kernel/db/dblist.php (revision 15127) +++ core/kernel/db/dblist.php (working copy) @@ -527,8 +527,7 @@ } $this->Queried = true; - $query_event = new kEvent($this->getPrefixSpecial() . ':OnAfterListQuery'); - $this->Application->HandleEvent($query_event); + $this->Application->HandleEvent(new kEvent($this->getPrefixSpecial() . ':OnAfterListQuery')); return true; } Index: core/kernel/event_handler.php =================================================================== --- core/kernel/event_handler.php (revision 15111) +++ core/kernel/event_handler.php (working copy) @@ -106,7 +106,7 @@ * @param kEvent $event * @access public */ - public function processEvent(kEvent &$event) + public function processEvent(kEvent $event) { $event_name = $event->Name; @@ -129,7 +129,7 @@ * @return void * @access protected */ - protected function OnBuild(kEvent &$event) + protected function OnBuild(kEvent $event) { } @@ -141,7 +141,7 @@ * @return void * @access protected */ - protected function OnGoBack(kEvent &$event) + protected function OnGoBack(kEvent $event) { $url = $this->Application->RecallVar('export_finish_url'); @@ -162,7 +162,7 @@ * @return void * @access protected */ - protected function prepareObject(&$object, kEvent &$event) + protected function prepareObject(&$object, kEvent $event) { } @@ -174,7 +174,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ @@ -189,7 +189,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { } Index: core/kernel/event_manager.php =================================================================== --- core/kernel/event_manager.php (revision 15111) +++ core/kernel/event_manager.php (working copy) @@ -203,7 +203,7 @@ * @return bool * @access protected */ - protected function isRecursion(&$event) + protected function isRecursion($event) { $event_key = $event->getPrefixSpecial() . ':' . $event->Name; @@ -216,7 +216,7 @@ * @param kEvent $event * @access protected */ - protected function pushEvent(&$event) + protected function pushEvent($event) { $event_key = $event->getPrefixSpecial() . ':' . $event->Name; @@ -239,7 +239,7 @@ * @param kEvent $event * @access public */ - public function HandleEvent(&$event) + public function HandleEvent($event) { if ( $this->isRecursion($event) || !$this->verifyEventPrefix($event) ) { return; @@ -279,7 +279,7 @@ * @return string * @access public */ - public function verifyEventPrefix(&$event, $is_fatal = false) + public function verifyEventPrefix($event, $is_fatal = false) { if ( !$this->Application->prefixRegistred($event->Prefix) ) { $this->Application->UnitConfigReader->loadConfig($event->Prefix); Index: core/kernel/kbase.php =================================================================== --- core/kernel/kbase.php (revision 15111) +++ core/kernel/kbase.php (working copy) @@ -65,20 +65,13 @@ /** * Set's references to kApplication and kDBConnection class instances * - * @param kApplication $application * @access public * @see kApplication * @see kDBConnection */ - public function __construct($application = null) + public function __construct() { - if (!isset($application)) { - $this->Application =& kApplication::Instance(); - } - else { - $this->Application =& $application; - } - + $this->Application =& kApplication::Instance(); $this->Conn =& $this->Application->GetADODBConnection(); } @@ -253,7 +246,7 @@ * @return void * @access public */ - public function setParentEvent(&$event) + public function setParentEvent($event) { $this->parentEvent =& $event; } Index: core/kernel/managers/cache_manager.php =================================================================== --- core/kernel/managers/cache_manager.php (revision 15111) +++ core/kernel/managers/cache_manager.php (working copy) @@ -75,12 +75,11 @@ /** * Set's references to kApplication and kDBConnection class instances * - * @param kApplication $application * @access public */ - public function __construct($application = null) + public function __construct() { - parent::__construct($application); + parent::__construct(); $this->settingTableName = TABLE_PREFIX . 'SystemSettings'; @@ -310,7 +309,7 @@ { // maybe discover keys automatically from corresponding classes $cache_keys = Array ( - 'Factory.Files', 'Factory.realClasses', 'Factory.Dependencies', + 'Factory.Files', 'Factory.realClasses', 'ConfigReader.prefixFiles', 'EventManager.beforeHooks', 'EventManager.afterHooks', 'EventManager.scheduledTasks', 'EventManager.buildEvents', 'Application.ReplacementTemplates', 'Application.RewriteListeners', 'Application.ModuleInfo', Index: core/kernel/managers/hook_manager.php =================================================================== --- core/kernel/managers/hook_manager.php (revision 15111) +++ core/kernel/managers/hook_manager.php (working copy) @@ -118,7 +118,7 @@ * @param int $mode hBEFORE or hAFTER * @access public */ - public function runHooks(&$event, $mode) + public function runHooks($event, $mode) { // * - get hooks that are valid with any special of given prefix $hooks = array_merge( @@ -169,7 +169,7 @@ * @return Array * @access protected */ - protected function &_getHooks(&$event, $mode, $event_key = null) + protected function &_getHooks($event, $mode, $event_key = null) { $hooks =& $this->getHooksByMode($mode); $event_key = isset($event_key) ? $event_key : $event->getPrefixSpecial(); Index: core/kernel/managers/request_manager.php =================================================================== --- core/kernel/managers/request_manager.php (revision 15111) +++ core/kernel/managers/request_manager.php (working copy) @@ -169,7 +169,7 @@ * @param kEvent $event * @access protected */ - protected function processPermissionError(&$event) + protected function processPermissionError($event) { // should do redirect but to no_permissions template $event->redirect = $this->Application->isAdmin ? 'no_permission' : $this->Application->ConfigValue('NoPermissionTemplate'); @@ -194,7 +194,7 @@ * @param kEvent $event * @access protected */ - protected function performRedirect(&$event) + protected function performRedirect($event) { // we need to pass category if the action was submitted to self-template, with the category passed // and it has not explicitly set redirect template or pass_category param @@ -231,7 +231,7 @@ * @return bool * @access protected */ - protected function canRedirect(&$event) + protected function canRedirect($event) { return $this->samePageRedirect($event) || strlen($event->redirect) > 0; } @@ -243,7 +243,7 @@ * @return bool * @access protected */ - protected function samePageRedirect(&$event) + protected function samePageRedirect($event) { return $event->redirect === true || $event->redirect == $this->Application->GetVar('t'); } Index: core/kernel/nparser/nparser_config.php =================================================================== --- core/kernel/nparser/nparser_config.php (revision 15111) +++ core/kernel/nparser/nparser_config.php (working copy) @@ -20,6 +20,6 @@ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), 'RegisterClasses' => Array( - Array('pseudo'=>'NParserCompiler','class'=>'NParserCompiler','file'=>'compiler.php','build_event'=>'','require_classes'=>'kHelper'), + Array('pseudo' => 'NParserCompiler', 'class' => 'NParserCompiler', 'file' => 'compiler.php', 'build_event' => ''), ), ); Index: core/kernel/session/session.php =================================================================== --- core/kernel/session/session.php (revision 15111) +++ core/kernel/session/session.php (working copy) @@ -302,8 +302,7 @@ // case #1: I've OR other site visitor expired my session // case #2: I have no session in database, but SID is present $this->expired = false; - $expire_event = new kEvent('u:OnSessionExpire'); - $this->Application->HandleEvent($expire_event); + $this->Application->HandleEvent(new kEvent('u:OnSessionExpire')); } } Index: core/kernel/utility/debugger.php =================================================================== --- core/kernel/utility/debugger.php (revision 15115) +++ core/kernel/utility/debugger.php (working copy) @@ -1533,17 +1533,27 @@ $application =& kApplication::Instance(); $dbg_path = str_replace(FULL_PATH, '', $this->tempFolder); + $debugger_params = Array ( + 'RowSeparator' => $this->rowSeparator, + 'ErrorsCount' => (int)$this->getProfilerTotal('error_handling'), + 'IsFatalError' => $this->IsFatalError ? 'true' : 'false', + 'SQLCount' => (int)$this->getProfilerTotal('sql'), + 'SQLTime' => isset($this->ProfilerTotals['sql']) ? sprintf('%.5f', $this->ProfilerTotals['sql']) : 0, + 'ScriptTime' => sprintf('%.5f', $this->ProfilerData['script_runtime']['ends'] - $this->ProfilerData['script_runtime']['begins']), + 'ScriptMemory' => DebuggerUtil::formatSize($this->getMemoryUsed($debugger_start)), + ); + ob_start(); // the - + ProfilerTotals['error_handling']) ) { - $memory_used = $debugger_start; - $this->ProfilerTotalCount['error_handling'] = 0; - } - else { - $memory_used = $debugger_start - $this->ProfilerTotals['error_handling']; - } - if ( $returnResult ) { $ret = ob_get_contents(); if ( $clean_output_buffer ) { ob_end_clean(); } - $ret .= $this->getShortReport($memory_used); + $ret .= $this->getShortReport($this->getMemoryUsed($debugger_start)); $this->reportDone = true; return $ret; @@ -1589,7 +1591,7 @@ elseif ( $clean_output_buffer ) { ob_clean(); } - echo $this->getShortReport($memory_used); + echo $this->getShortReport($this->getMemoryUsed($debugger_start)); $this->reportDone = true; } @@ -1597,6 +1599,19 @@ return ''; } + function getMemoryUsed($debugger_start) + { + if ( !isset($this->ProfilerTotals['error_handling']) ) { + $memory_used = $debugger_start; + $this->ProfilerTotalCount['error_handling'] = 0; + } + else { + $memory_used = $debugger_start - $this->ProfilerTotals['error_handling']; + } + + return $memory_used; + } + /** * Format's memory usage report by debugger * @@ -1607,11 +1622,8 @@ private function getShortReport($memory_used) { if ( DebuggerUtil::constOn('DBG_TOOLBAR_BUTTONS') ) { - // we have sql & error count in toolbar, don't duplicate here - $info = Array ( - 'Script Runtime' => 'PROFILE:script_runtime', - 'SQL\'s Runtime' => 'PROFILE_T:sql', - ); + // evenrything is in toolbar - don't duplicate + return ''; } else { // toolbar not visible, then show sql & error count too @@ -1624,7 +1636,7 @@ ); } - $ret = 'Application:' . DebuggerUtil::formatSize($memory_used) . ' (' . $memory_used . ')'; + $ret = ''; // 'Application:' . DebuggerUtil::formatSize($memory_used) . ' (' . $memory_used . ')'; foreach ($info as $title => $value_key) { list ($record_type, $record_data) = explode(':', $value_key, 2); Index: core/kernel/utility/debugger/debugger.js =================================================================== --- core/kernel/utility/debugger/debugger.js (revision 15111) +++ core/kernel/utility/debugger/debugger.js (working copy) @@ -58,11 +58,19 @@ } // Debugger -function Debugger($row_separator, $errors_count, $fatal_error, $sql_count) { - this.RowSeparator = $row_separator; - this.IsFatalError = $fatal_error; - this.ErrorsCount = parseInt($errors_count); - this.SQLCount = parseInt($sql_count); +function Debugger($params) { + this.RowSeparator = ''; + this.IsFatalError = false; + this.ErrorsCount = 0; + this.SQLCount = 0; + this.SQLTime = 0; + this.ScriptTime = 0; + this.ScriptMemory = 0; + + for (var $param_name in $params) { + this[$param_name] = $params[$param_name]; + } + this.IsQueried = false; this.IsVisible = false; this.DebuggerDIV = document.getElementById('debug_layer'); @@ -181,9 +189,13 @@ $toolbar_content += 'Turn Off'; if (this.SQLCount > 0) { - $toolbar_content += '' + this.SQLCount + ' sqls'; + $toolbar_content += '' + this.SQLCount + ' sqls (' + this.SQLTime + ' s)'; } + if (this.ScriptTime > 0) { + $toolbar_content += '' + this.ScriptTime + ' s (' + this.ScriptMemory + ')'; + } + $span.innerHTML = '' + $toolbar_content + '
'; this.DebuggerToolbar = $span; Index: core/kernel/utility/factory.php =================================================================== --- core/kernel/utility/factory.php (revision 15111) +++ core/kernel/utility/factory.php (working copy) @@ -12,329 +12,280 @@ * See http://www.in-portal.org/license for copyright notices and details. */ - defined('FULL_PATH') or die('restricted access!'); +defined('FULL_PATH') or die('restricted access!'); - class kFactory extends kBase implements kiCacheable { +class kFactory extends kBase implements kiCacheable { - /** - * Where all created objects are stored - * - * @var Array - * @access private - */ - var $Storage = Array (); + /** + * Where all created objects are stored + * + * @var Array + * @access protected + */ + protected $Storage = Array (); - /** - * Map between class name and file name - * where class definition can be found. - * File path absolute! - * - * @var Array - * @access private - */ - var $Files = Array (); + /** + * Mapping between class name and file name + * where class definition can be found. + * File path absolute! + * + * @var Array + * @access protected + */ + protected $Files = Array (); - /** - * Map class names to their pseudo - * class names, e.g. key=pseudo_class, - * value=real_class_name - * - * @var Array - * @access private - */ - var $realClasses = Array (); + /** + * Map class names to their pseudo + * class names, e.g. key=pseudo_class, + * value=real_class_name + * + * @var Array + * @access protected + */ + protected $realClasses = Array (); - /** - * class name vs other classnames it's require for existing - * - * @var Array - */ - var $Dependencies = Array (); + public function __construct() + { + parent::__construct(); - /** - * Sets data from cache to object - * - * @param Array $data - * @access public - */ - public function setFromCache(&$data) - { - $this->Files = $data['Factory.Files']; - $this->realClasses = $data['Factory.realClasses']; - $this->Dependencies = $data['Factory.Dependencies']; - } + spl_autoload_register(Array (&$this, 'autoload')); + } - /** - * Gets object data for caching - * - * @access public - * @return Array - */ - public function getToCache() - { - return Array ( - 'Factory.Files' => $this->Files, - 'Factory.realClasses' => $this->realClasses, - 'Factory.Dependencies' => $this->Dependencies, - ); + /** + * Sets data from cache to object + * + * @param Array $data + * @return void + * @access public + */ + public function setFromCache(&$data) + { + $this->Files = $data['Factory.Files']; + $this->realClasses = $data['Factory.realClasses']; + } + + /** + * Performs automatic loading of classes registered with the factory + * + * @param string $class_name + * @return void + * @throws Exception + * @access public + */ + public function autoload($class_name) + { + if ( !isset($this->Files[$class_name]) ) { + // class not from our factory -> let other autoloaders handle it + return; } - /** - * Splits any mixing of prefix and - * special into correct ones - * - * @param string $prefix_special - * @return Array - * @access public - */ - function processPrefix($prefix_special) - { - // l.pick, l, m.test_TagProcessor - - //preg_match("/(.*)\.*(.*)(_*)(.*)/", $prefix_special, $regs); - //return Array('prefix'=>$regs[1].$regs[3].$regs[4], 'special'=>$regs[2]); - - $tmp=explode('_',$prefix_special,2); - $tmp[0]=explode('.',$tmp[0]); - - $prefix=$tmp[0][0]; - $prefix_special=$prefix; // new1 - if( isset($tmp[1]) ) - { - $prefix.='_'.$tmp[1]; - } - $special= isset($tmp[0][1]) ? $tmp[0][1] : ''; - $prefix_special.='.'.$special; // new2 - - return Array('prefix'=>$prefix,'special'=>$special,'prefix_special'=>$prefix_special); + if ( !file_exists(FULL_PATH . $this->Files[$class_name]) ) { + throw new Exception('File ' . FULL_PATH . $this->Files[$class_name] . ' containing class ' . $class_name . ' definition not found'); } + kUtil::includeOnce(FULL_PATH . $this->Files[$class_name]); + } - /** - * Returns object using params specified, creates it if is required - * - * @param string $name - * @param string $pseudo_class - * @param Array $event_params - * @param Array $arguments - * @return kBase - */ - function &getObject($name, $pseudo_class = '', $event_params = Array (), $arguments = Array ()) - { - $name = rtrim($name, '.'); + /** + * Gets object data for caching + * + * @return Array + * @access public + */ + public function getToCache() + { + return Array ( + 'Factory.Files' => $this->Files, + 'Factory.realClasses' => $this->realClasses, + ); + } - if ( isset($this->Storage[$name]) ) { - return $this->Storage[$name]; - } + /** + * Splits any mixing of prefix and + * special into correct ones + * + * @param string $prefix_special + * @return Array + * @access public + */ + public function processPrefix($prefix_special) + { + // l.pick, l, m.test_TagProcessor - $ret = $this->processPrefix($name); + //preg_match("/(.*)\.*(.*)(_*)(.*)/", $prefix_special, $regs); + //return Array('prefix'=>$regs[1].$regs[3].$regs[4], 'special'=>$regs[2]); - if (!$pseudo_class) { - $pseudo_class = $ret['prefix']; - } + $tmp = explode('_', $prefix_special, 2); + $tmp[0] = explode('.', $tmp[0]); - if ( !isset($this->realClasses[$pseudo_class]) ) { - $error_msg = 'RealClass not defined for pseudo_class ' . $pseudo_class . ''; + $prefix = $tmp[0][0]; + $prefix_special = $prefix; // new1 - if ( $this->Application->isInstalled() ) { - throw new Exception($error_msg); - } - else { - if ( $this->Application->isDebugMode() ) { - $this->Application->Debugger->appendTrace(); - } + if ( isset($tmp[1]) ) { + $prefix .= '_' . $tmp[1]; + } - trigger_error($error_msg, E_USER_WARNING); - } + $special = isset($tmp[0][1]) ? $tmp[0][1] : ''; + $prefix_special .= '.' . $special; // new2 - $false = false; - return $false; - } + return Array ('prefix' => $prefix, 'special' => $special, 'prefix_special' => $prefix_special); + } - if ( defined('DEBUG_MODE') && defined('DBG_FACTORY') && DBG_FACTORY && $this->Application->isDebugMode() ) { - $this->Application->Debugger->appendHTML('Creating object: Pseudo class: '.$pseudo_class.' Prefix: '.$name); - $this->Application->Debugger->appendTrace(); - } - $this->Storage[$name] =& $this->makeClass($pseudo_class, $arguments); - $this->Storage[$name]->Init($ret['prefix'], $ret['special']); - $this->Application->EventManager->runBuildEvent($ret['prefix_special'], $pseudo_class, $event_params); + /** + * Returns object using params specified, creates it if is required + * + * @param string $name + * @param string $pseudo_class + * @param Array $event_params + * @param Array $arguments + * @return kBase + * @access public + */ + public function &getObject($name, $pseudo_class = '', $event_params = Array (), $arguments = Array ()) + { + $name = rtrim($name, '.'); + if ( isset($this->Storage[$name]) ) { return $this->Storage[$name]; } - /** - * Removes object from storage, so next time it could be created from scratch - * - * @param string $name Object's name in the Storage - */ - function DestroyObject($name) - { - unset($this->Storage[$name]); + $ret = $this->processPrefix($name); + + if ( !$pseudo_class ) { + $pseudo_class = $ret['prefix']; } - /** - * Includes file containing class - * definition for real class name - * - * @param string $real_class - * @param string $pseudo_class - * @access private - */ - function includeClassFile($real_class, $pseudo_class = null) - { - if ( class_exists($real_class) ) { - return; - } + if ( !isset($this->realClasses[$pseudo_class]) ) { + $error_msg = 'RealClass not defined for pseudo_class ' . $pseudo_class . ''; - if( !isset($this->Files[$real_class]) ) { - throw new Exception('Real Class ' . $real_class . ' (for pseudo class ' . $pseudo_class . ') is not registered with the Factory'); + if ( $this->Application->isInstalled() ) { + throw new Exception($error_msg); } + else { + if ( $this->Application->isDebugMode() ) { + $this->Application->Debugger->appendTrace(); + } - if( !file_exists(FULL_PATH . $this->Files[$real_class]) ) { - throw new Exception('Include file for class ' . $real_class . ' (' . FULL_PATH . $this->Files[$real_class] . ') does not exists'); + trigger_error($error_msg, E_USER_WARNING); } - if( isset( $this->Dependencies[$real_class] ) ) - { - foreach($this->Dependencies[$real_class] as $dep_class_name) - { - $this->includeClassFile($dep_class_name, $pseudo_class); - } - } + $false = false; + return $false; + } - kUtil::includeOnce(FULL_PATH.$this->Files[$real_class]); + if ( defined('DEBUG_MODE') && defined('DBG_FACTORY') && DBG_FACTORY && $this->Application->isDebugMode() ) { + $this->Application->Debugger->appendHTML('Creating object: Pseudo class: ' . $pseudo_class . ' Prefix: ' . $name); + $this->Application->Debugger->appendTrace(); } - /** - * Get's real class name for pseudo class, - * includes class file and creates class - * instance. - * All parameters except first one are passed to object constuctor - * through mediator method makeClass that creates instance of class - * - * Pattern: Factory Method - * - * @param string $pseudo_class - * @param Array $arguments - * @return kBase - * @access public - */ - public function &makeClass($pseudo_class, $arguments = Array ()) - { - $real_class = $this->realClasses[$pseudo_class]; + $this->Storage[$name] =& $this->makeClass($pseudo_class, $arguments); + $this->Storage[$name]->Init($ret['prefix'], $ret['special']); + $this->Application->EventManager->runBuildEvent($ret['prefix_special'], $pseudo_class, $event_params); - if ( !class_exists($real_class) ) { - $this->includeClassFile($real_class, $pseudo_class); - } + return $this->Storage[$name]; + } - $mem_before = memory_get_usage(); - $time_before = microtime(true); + /** + * Removes object from storage, so next time it could be created from scratch + * + * @param string $name Object's name in the Storage + * @return void + * @access public + */ + public function DestroyObject($name) + { + unset($this->Storage[$name]); + } - if ( !is_array($arguments) ) { - // fallback for code, that doesn't know how to pass arguments - $arguments = Array ($arguments); - } + /** + * Checks if object with prefix passes was already created in factory + * + * @param string $name object pseudo_class, prefix + * @return bool + * @access public + */ + public function hasObject($name) + { + return isset($this->Storage[$name]); + } - if (!$arguments) { - $class = new $real_class(); - } - else { - $reflection = new ReflectionClass($real_class); - $class = $reflection->newInstanceArgs($arguments); - } + /** + * Get's real class name for pseudo class, + * includes class file and creates class + * instance. + * All parameters except first one are passed to object constuctor + * through mediator method makeClass that creates instance of class + * + * Pattern: Factory Method + * + * @param string $pseudo_class + * @param Array $arguments + * @return kBase + * @access public + */ + public function &makeClass($pseudo_class, $arguments = Array ()) + { + $real_class = $this->realClasses[$pseudo_class]; - if ( defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_PROFILE_MEMORY') && DBG_PROFILE_MEMORY && $this->Application->isDebugMode() ) { - $mem_after = memory_get_usage(); - $time_after = microtime(true); - $mem_used = $mem_after - $mem_before; - $time_used = $time_after - $time_before; + $mem_before = memory_get_usage(); + $time_before = microtime(true); - $this->Application->Debugger->appendHTML('Factroy created '.$real_class.' - used '.round($mem_used/1024, 3).'Kb time: '.round($time_used, 5)); - $this->Application->Debugger->profilerAddTotal('objects', null, $mem_used); - } + $arguments = (array)$arguments; - return $class; + if ( !$arguments ) { + $class = new $real_class(); } + else { + $reflection = new ReflectionClass($real_class); + $class = $reflection->newInstanceArgs($arguments); + } - /** - * Registers new class in the factory - * - * @param string $real_class Real name of class as in class declaration - * @param string $file Filename in what $real_class is declared - * @param string $pseudo_class Name under this class object will be accessed using getObject method - * @param Array $dependecies List of classes required for this class functioning - * @access public - */ - function registerClass($real_class, $file, $pseudo_class=null, $dependecies = Array() ) - { - if ( !isset($pseudo_class) ) { - $pseudo_class = $real_class; - } + if ( defined('DEBUG_MODE') && DEBUG_MODE && defined('DBG_PROFILE_MEMORY') && DBG_PROFILE_MEMORY && $this->Application->isDebugMode() ) { + $mem_after = memory_get_usage(); + $time_after = microtime(true); + $mem_used = $mem_after - $mem_before; + $time_used = $time_after - $time_before; - if ( !isset($this->Files[$real_class]) ) { - $this->Files[$real_class] = preg_replace('/^'.preg_quote(FULL_PATH, '/').'/', '', $file, 1); - } + $this->Application->Debugger->appendHTML('Factroy created ' . $real_class . ' - used ' . round($mem_used / 1024, 3) . 'Kb time: ' . round($time_used, 5)); + $this->Application->Debugger->profilerAddTotal('objects', null, $mem_used); + } - if ( isset($this->realClasses[$pseudo_class]) ) { - $this->registerDependency($real_class, $pseudo_class); - } + return $class; + } - if ($dependecies) { - if ( !is_array($dependecies) ) { - $dependecies = Array ($dependecies); - } - - foreach ($dependecies as $required_class) { - $this->registerDependency($real_class, $required_class); - } - } - - $this->realClasses[$pseudo_class] = $real_class; + /** + * Registers new class in the factory + * + * @param string $real_class Real name of class as in class declaration + * @param string $file Filename in what $real_class is declared + * @param string $pseudo_class Name under this class object will be accessed using getObject method + * @return void + * @access public + */ + public function registerClass($real_class, $file, $pseudo_class = null) + { + if ( !isset($pseudo_class) ) { + $pseudo_class = $real_class; } - /** - * Unregisters existing class from factory - * - * @param string $real_class Real name of class as in class declaration - * @param string $pseudo_class Name under this class object is accessed using getObject method - */ - function unregisterClass($real_class, $pseudo_class = null) - { - if ( !isset($pseudo_class) ) { - $pseudo_class = $real_class; - } - - unset($this->Files[$real_class]); - - if ( !array_key_exists($real_class, $this->Dependencies) ) { - return ; - } - - $this->realClasses[$pseudo_class] = $this->Dependencies[$real_class][0]; - unset( $this->Dependencies[$real_class] ); + if ( !isset($this->Files[$real_class]) ) { + $this->Files[$real_class] = preg_replace('/^' . preg_quote(FULL_PATH, '/') . '/', '', $file, 1); } - /** - * Add $class_name to required classes list for $depended_class class. - * All required class files are included before $depended_class file is included - * - * @param string $depended_class - * @param string $class_name - * @author Alex - */ - function registerDependency($depended_class, $class_name) - { - if ($this->realClasses[$class_name] == $depended_class) { - // same class - return ; - } + $this->realClasses[$pseudo_class] = $real_class; + } - $dependencies =& $this->Dependencies[$depended_class]; - $dependency_exists = is_array($dependencies) && in_array($this->realClasses[$class_name], $dependencies); - - if ( !$dependency_exists ) { - $dependencies[] = $this->realClasses[$class_name]; - } - } - } \ No newline at end of file + /** + * Unregisters existing class from factory + * + * @param string $real_class Real name of class as in class declaration + * @param string $pseudo_class Name under this class object is accessed using getObject method + * @return void + * @access public + */ + public function unregisterClass($real_class, $pseudo_class = null) + { + unset($this->Files[$real_class]); + } +} \ No newline at end of file Index: core/kernel/utility/formatters/formatters_config.php =================================================================== --- core/kernel/utility/formatters/formatters_config.php (revision 15111) +++ core/kernel/utility/formatters/formatters_config.php (working copy) @@ -20,18 +20,18 @@ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), 'RegisterClasses' => Array( - Array('pseudo'=>'kFormatter','class'=>'kFormatter','file'=>'formatter.php','build_event'=>'','require_classes'=>''), - Array('pseudo'=>'kOptionsFormatter','class'=>'kOptionsFormatter','file'=>'options_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kLEFTFormatter','class'=>'kLEFTFormatter','file'=>'left_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kDateFormatter','class'=>'kDateFormatter','file'=>'date_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kUploadFormatter','class'=>'kUploadFormatter','file'=>'upload_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kPictureFormatter','class'=>'kPictureFormatter','file'=>'upload_formatter.php','build_event'=>'','require_classes'=>'kUploadFormatter'), - Array('pseudo'=>'kMultiLanguage','class'=>'kMultiLanguage','file'=>'multilang_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kPasswordFormatter','class'=>'kPasswordFormatter','file'=>'password_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kCCDateFormatter','class'=>'kCCDateFormatter','file'=>'ccdate_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kUnitFormatter','class'=>'kUnitFormatter','file'=>'unit_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kFilesizeFormatter','class'=>'kFilesizeFormatter','file'=>'filesize_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kSerializedFormatter','class'=>'kSerializedFormatter','file'=>'serialized_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), - Array('pseudo'=>'kCustomFieldFormatter','class'=>'kCustomFieldFormatter','file'=>'customfield_formatter.php','build_event'=>'','require_classes'=>'kFormatter'), + Array('pseudo'=>'kFormatter','class'=>'kFormatter','file'=>'formatter.php','build_event'=>''), + Array('pseudo'=>'kOptionsFormatter','class'=>'kOptionsFormatter','file'=>'options_formatter.php','build_event'=>''), + Array('pseudo'=>'kLEFTFormatter','class'=>'kLEFTFormatter','file'=>'left_formatter.php','build_event'=>''), + Array('pseudo'=>'kDateFormatter','class'=>'kDateFormatter','file'=>'date_formatter.php','build_event'=>''), + Array('pseudo'=>'kUploadFormatter','class'=>'kUploadFormatter','file'=>'upload_formatter.php','build_event'=>''), + Array('pseudo'=>'kPictureFormatter','class'=>'kPictureFormatter','file'=>'upload_formatter.php','build_event'=>''), + Array('pseudo'=>'kMultiLanguage','class'=>'kMultiLanguage','file'=>'multilang_formatter.php','build_event'=>''), + Array('pseudo'=>'kPasswordFormatter','class'=>'kPasswordFormatter','file'=>'password_formatter.php','build_event'=>''), + Array('pseudo'=>'kCCDateFormatter','class'=>'kCCDateFormatter','file'=>'ccdate_formatter.php','build_event'=>''), + Array('pseudo'=>'kUnitFormatter','class'=>'kUnitFormatter','file'=>'unit_formatter.php','build_event'=>''), + Array('pseudo'=>'kFilesizeFormatter','class'=>'kFilesizeFormatter','file'=>'filesize_formatter.php','build_event'=>''), + Array('pseudo'=>'kSerializedFormatter','class'=>'kSerializedFormatter','file'=>'serialized_formatter.php','build_event'=>''), + Array('pseudo'=>'kCustomFieldFormatter','class'=>'kCustomFieldFormatter','file'=>'customfield_formatter.php','build_event'=>''), ), ); Index: core/kernel/utility/temp_handler.php =================================================================== --- core/kernel/utility/temp_handler.php (revision 15111) +++ core/kernel/utility/temp_handler.php (working copy) @@ -80,7 +80,7 @@ * @return void * @access public */ - public function setParentEvent(&$event) + public function setParentEvent($event) { $this->parentEvent =& $event; } Index: core/kernel/utility/unit_config_reader.php =================================================================== --- core/kernel/utility/unit_config_reader.php (revision 15111) +++ core/kernel/utility/unit_config_reader.php (working copy) @@ -238,7 +238,7 @@ */ function ParseConfigs() { - // 1. process normal configs and their dependencies + // 1. process normal configs $prioritized_configs = array(); foreach ($this->configData as $prefix => $config) { if (isset($config['ConfigPriority'])) { @@ -249,20 +249,15 @@ } foreach ($this->configData as $prefix => $config) { - $this->ProcessDependencies($prefix); $this->postProcessConfig($prefix, 'AggregateConfigs', 'sub_prefix'); $clones = $this->postProcessConfig($prefix, 'Clones', 'prefix'); } - // 2. process prioritized configs and their dependencies + // 2. process prioritized configs asort($prioritized_configs); foreach ($prioritized_configs as $prefix => $priority) { $this->parseConfig($prefix); } - - foreach ($prioritized_configs as $prefix => $priority) { - $this->ProcessDependencies($prefix); - } } function AfterConfigRead($store_cache = null) @@ -287,8 +282,7 @@ if ($store_cache) { $this->_sortRewriteListeners(); - $after_event = new kEvent('adm:OnAfterCacheRebuild'); - $this->Application->HandleEvent($after_event); + $this->Application->HandleEvent(new kEvent('adm:OnAfterCacheRebuild')); $this->Application->cacheManager->UpdateUnitCache(); @@ -433,23 +427,8 @@ $register_classes = $this->getClasses($prefix); foreach ($register_classes as $class_info) { - // remember class dependencies - $class_name = $class_info['class']; - $require_classes = isset($class_info['require_classes']) ? $class_info['require_classes'] : Array (); - - if ($require_classes) { - $require_classes = (array)$require_classes; - - if ( !isset($config['_Dependencies'][$class_name]) ) { - $config['_Dependencies'][$class_name] = Array (); - } - - $config['_Dependencies'][$class_name] = array_merge($config['_Dependencies'][$class_name], $require_classes); - } - - // register class $this->Application->registerClass( - $class_name, + $class_info['class'], $config['BasePath'] . DIRECTORY_SEPARATOR . $class_info['file'], $class_info['pseudo'] ); @@ -706,25 +685,6 @@ return ''.var_export($value, true).' of '.gettype($value); } - protected function ProcessDependencies($prefix) - { - $config =& $this->configData[$prefix]; - $dependencies = getArrayValue($config, '_Dependencies'); - /* @var $dependencies Array */ - - if ( !$dependencies ) { - return ; - } - - foreach ($dependencies as $real_class => $requires) { - foreach ($requires as $class) { - $this->Application->registerDependency($real_class, $class); - } - } - - unset($config['_Dependencies']); - } - function postProcessConfig($prefix, $config_key, $dst_prefix_var) { $main_config =& $this->configData[$prefix]; Index: core/units/admin/admin_events_handler.php =================================================================== --- core/units/admin/admin_events_handler.php (revision 15112) +++ core/units/admin/admin_events_handler.php (working copy) @@ -44,7 +44,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $perm_value = null; @@ -116,7 +116,7 @@ * @return void * @access protected */ - protected function OnResetModRwCache(kEvent &$event) + protected function OnResetModRwCache(kEvent $event) { if ( $this->Application->GetVar('ajax') == 'yes' ) { $event->status = kEvent::erSTOP; @@ -134,7 +134,7 @@ * @return void * @access protected */ - protected function OnResetSections(kEvent &$event) + protected function OnResetSections(kEvent $event) { if ($this->Application->GetVar('ajax') == 'yes') { $event->status = kEvent::erSTOP; @@ -158,7 +158,7 @@ * @return void * @access protected */ - protected function OnResetConfigsCache(kEvent &$event) + protected function OnResetConfigsCache(kEvent $event) { if ( $this->Application->GetVar('ajax') == 'yes' ) { $event->status = kEvent::erSTOP; @@ -186,7 +186,7 @@ * @return void * @access protected */ - protected function OnResetParsedData(kEvent &$event) + protected function OnResetParsedData(kEvent $event) { if ( $this->Application->GetVar('ajax') == 'yes' ) { $event->status = kEvent::erSTOP; @@ -208,7 +208,7 @@ * @return void * @access protected */ - protected function OnResetMemcache(kEvent &$event) + protected function OnResetMemcache(kEvent $event) { if ($this->Application->GetVar('ajax') == 'yes') { $event->status = kEvent::erSTOP; @@ -225,7 +225,7 @@ * @return void * @access protected */ - protected function OnCompileTemplates(kEvent &$event) + protected function OnCompileTemplates(kEvent $event) { $compiler =& $this->Application->recallObject('NParserCompiler'); /* @var $compiler NParserCompiler */ @@ -241,7 +241,7 @@ * @return void * @access protected */ - protected function OnDeleteCompiledTemplates(kEvent &$event) + protected function OnDeleteCompiledTemplates(kEvent $event) { if ( $this->Application->GetVar('ajax') == 'yes' ) { $event->status = kEvent::erSTOP; @@ -300,7 +300,7 @@ * @return void * @access protected */ - protected function OnGenerateTableStructure(kEvent &$event) + protected function OnGenerateTableStructure(kEvent $event) { $types_hash = Array ( 'string' => 'varchar|text|mediumtext|longtext|date|datetime|time|timestamp|char|year|enum|set', @@ -469,7 +469,7 @@ * @return void * @access protected */ - protected function OnRebuildThemes(kEvent &$event) + protected function OnRebuildThemes(kEvent $event) { if ( $this->Application->GetVar('ajax') == 'yes' ) { $event->status = kEvent::erSTOP; @@ -490,7 +490,7 @@ * @return void * @access protected */ - protected function OnSaveColumns(kEvent &$event) + protected function OnSaveColumns(kEvent $event) { $picker_helper =& $this->Application->recallObject('ColumnPickerHelper'); /* @var $picker_helper kColumnPickerHelper */ @@ -513,7 +513,7 @@ * @return void * @access protected */ - protected function OnSaveSetting(kEvent &$event) + protected function OnSaveSetting(kEvent $event) { if ( $this->Application->GetVar('ajax') != 'yes' ) { return; @@ -534,7 +534,7 @@ * @return void * @access protected */ - protected function OnClosePopup(kEvent &$event) + protected function OnClosePopup(kEvent $event) { $event->SetRedirectParam('opener', 'u'); } @@ -546,7 +546,7 @@ * @return void * @access protected */ - protected function OnStartup(kEvent &$event) + protected function OnStartup(kEvent $event) { if ( $this->Application->isAdmin ) { return; @@ -568,7 +568,7 @@ * @return void * @access protected */ - protected function OnBeforeShutdown(kEvent &$event) + protected function OnBeforeShutdown(kEvent $event) { } @@ -580,7 +580,7 @@ * @return void * @access protected */ - protected function OnAfterBuildTree(kEvent &$event) + protected function OnAfterBuildTree(kEvent $event) { } @@ -592,7 +592,7 @@ * @return void * @access protected */ - protected function OnExportCSV(kEvent &$event) + protected function OnExportCSV(kEvent $event) { $csv_helper =& $this->Application->recallObject('CSVHelper'); /* @var $csv_helper kCSVHelper */ @@ -610,7 +610,7 @@ * @return void * @access protected */ - protected function OnGetCSV(kEvent &$event) + protected function OnGetCSV(kEvent $event) { $csv_helper =& $this->Application->recallObject('CSVHelper'); /* @var $csv_helper kCSVHelper */ @@ -625,7 +625,7 @@ * @return void * @access protected */ - protected function OnCSVImportBegin(kEvent &$event) + protected function OnCSVImportBegin(kEvent $event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -664,7 +664,7 @@ * @return void * @access protected */ - protected function OnCSVImportStep(kEvent &$event) + protected function OnCSVImportStep(kEvent $event) { $import_helper =& $this->Application->recallObject('CSVHelper'); /* @var $import_helper kCSVHelper */ @@ -680,7 +680,7 @@ * @return void * @access protected */ - protected function OnCheckPrefixConfig(kEvent &$event) + protected function OnCheckPrefixConfig(kEvent $event) { $prefix = $this->Application->GetVar('config_prefix'); $config_file = $this->Application->UnitConfigReader->prefixFiles[$prefix]; @@ -713,7 +713,7 @@ * @return void * @access protected */ - protected function OnDropTempTablesByWID(kEvent &$event) + protected function OnDropTempTablesByWID(kEvent $event) { $sid = $this->Application->GetSID(); $wid = $this->Application->GetVar('m_wid'); @@ -738,7 +738,7 @@ * @return void * @access protected */ - protected function OnBackup(kEvent &$event) + protected function OnBackup(kEvent $event) { $backup_helper =& $this->Application->recallObject('BackupHelper'); /* @var $backup_helper BackupHelper */ @@ -757,7 +757,7 @@ * @return void * @access protected */ - protected function OnBackupProgress(kEvent &$event) + protected function OnBackupProgress(kEvent $event) { $backup_helper =& $this->Application->recallObject('BackupHelper'); /* @var $backup_helper BackupHelper */ @@ -780,7 +780,7 @@ * @return void * @access protected */ - protected function OnBackupCancel(kEvent &$event) + protected function OnBackupCancel(kEvent $event) { $event->redirect = 'tools/backup1'; } @@ -792,7 +792,7 @@ * @return void * @access protected */ - protected function OnRestore(kEvent &$event) + protected function OnRestore(kEvent $event) { $backup_helper =& $this->Application->recallObject('BackupHelper'); /* @var $backup_helper BackupHelper */ @@ -808,7 +808,7 @@ * @return void * @access protected */ - protected function OnRestoreProgress(kEvent &$event) + protected function OnRestoreProgress(kEvent $event) { $backup_helper =& $this->Application->recallObject('BackupHelper'); /* @var $backup_helper BackupHelper */ @@ -840,7 +840,7 @@ * @return void * @access protected */ - protected function OnRestoreCancel(kEvent &$event) + protected function OnRestoreCancel(kEvent $event) { $event->redirect = 'tools/restore1'; } @@ -852,7 +852,7 @@ * @return void * @access protected */ - protected function OnDeleteBackup(kEvent &$event) + protected function OnDeleteBackup(kEvent $event) { $backup_helper =& $this->Application->recallObject('BackupHelper'); /* @var $backup_helper BackupHelper */ @@ -867,7 +867,7 @@ * @return void * @access protected */ - protected function OnSqlQuery(kEvent &$event) + protected function OnSqlQuery(kEvent $event) { $sql = $this->Application->GetVar('sql'); @@ -902,7 +902,7 @@ * @return void * @access protected */ - protected function OnAfterCacheRebuild(kEvent &$event) + protected function OnAfterCacheRebuild(kEvent $event) { } @@ -914,7 +914,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -938,7 +938,7 @@ * @return void * @access protected */ - protected function OnSaveMenuFrameWidth(kEvent &$event) + protected function OnSaveMenuFrameWidth(kEvent $event) { $event->status = kEvent::erSTOP; @@ -956,7 +956,7 @@ * @return void * @access protected */ - protected function OnMemoryCacheGet(kEvent &$event) + protected function OnMemoryCacheGet(kEvent $event) { $event->status = kEvent::erSTOP; @@ -1001,7 +1001,7 @@ * @return void * @access protected */ - protected function OnMemoryCacheSet(kEvent &$event) + protected function OnMemoryCacheSet(kEvent $event) { $event->status = kEvent::erSTOP; @@ -1034,7 +1034,7 @@ * @return void * @access protected */ - protected function OnDeploy(kEvent &$event) + protected function OnDeploy(kEvent $event) { $deployment_helper =& $this->Application->recallObject('DeploymentHelper'); /* @var $deployment_helper DeploymentHelper */ @@ -1060,7 +1060,7 @@ * @return void * @access protected */ - protected function OnSynchronizeDBRevisions(kEvent &$event) + protected function OnSynchronizeDBRevisions(kEvent $event) { $deployment_helper =& $this->Application->recallObject('DeploymentHelper'); /* @var $deployment_helper DeploymentHelper */ @@ -1088,7 +1088,7 @@ * @return void * @access protected */ - protected function OnOptimizePerformance(kEvent &$event) + protected function OnOptimizePerformance(kEvent $event) { $start_time = adodb_mktime(); Index: core/units/admin/admin_tag_processor.php =================================================================== --- core/units/admin/admin_tag_processor.php (revision 15111) +++ core/units/admin/admin_tag_processor.php (working copy) @@ -594,7 +594,7 @@ $updater->OneStepRun(); - $this->Application->HandleEvent($event, 'c:OnResetCMSMenuCache'); + $this->Application->HandleEvent(new kEvent('c:OnResetCMSMenuCache')); } else { // update with progress bar Index: core/units/captcha/captcha_eh.php =================================================================== --- core/units/captcha/captcha_eh.php (revision 15111) +++ core/units/captcha/captcha_eh.php (working copy) @@ -21,7 +21,7 @@ * * @param kEvent $event */ - function OnValidateCode(&$event) + function OnValidateCode($event) { $captcha_helper =& $this->Application->recallObject('CaptchaHelper'); /* @var $captcha_helper kCaptchaHelper */ @@ -34,7 +34,7 @@ * * @param kEvent $event */ - function OnPrepareCaptcha(&$event) + function OnPrepareCaptcha($event) { $captcha_helper =& $this->Application->recallObject('CaptchaHelper'); /* @var $captcha_helper kCaptchaHelper */ Index: core/units/categories/categories_event_handler.php =================================================================== --- core/units/categories/categories_event_handler.php (revision 15111) +++ core/units/categories/categories_event_handler.php (working copy) @@ -65,7 +65,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnResetCMSMenuCache' ) { // events from "Tools -> System Tools" section are controlled via that section "edit" permission @@ -162,7 +162,7 @@ * @param kEvent $event * @return string */ - function _getPermissionCheckIDs(&$event) + function _getPermissionCheckIDs($event) { if ($event->Name == 'OnSave') { $selected_ids = implode(',', $this->getSelectedIDs($event, true)); @@ -184,7 +184,7 @@ * @param kEvent $event * @return Array */ - function _getPermissionCheckInfo(&$event) + function _getPermissionCheckInfo($event) { // when saving data from temp table to live table check by data from temp table $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); @@ -227,7 +227,7 @@ * @return void * @access protected */ - protected function OnEdit(kEvent &$event) + protected function OnEdit(kEvent $event) { $category_id = $this->Application->GetVar($event->getPrefixSpecial() . '_id'); $home_category = $this->Application->getBaseCategory(); @@ -247,7 +247,7 @@ * * @param kEvent $event */ - function OnProcessSelected(&$event) + function OnProcessSelected($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -269,7 +269,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -579,7 +579,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( ($event->Special == 'page') || ($event->Special == '-virtual') || ($event->Prefix == 'st') ) { return $this->_getPassedStructureID($event); @@ -598,7 +598,7 @@ * @param kEvent $event * @return int */ - function _getPassedStructureID(&$event) + function _getPassedStructureID($event) { static $page_by_template = Array (); @@ -668,7 +668,7 @@ return $page_id; } - function ParentGetPassedID(&$event) + function ParentGetPassedID($event) { return parent::getPassedID($event); } @@ -681,7 +681,7 @@ * @return void * @access protected */ - protected function prepareObject(&$object, kEvent &$event) + protected function prepareObject(&$object, kEvent $event) { if ( $event->Special == '-virtual' ) { return; @@ -707,7 +707,7 @@ * @return void * @access protected */ - protected function OnAfterCopyToLive(kEvent &$event) + protected function OnAfterCopyToLive(kEvent $event) { parent::OnAfterCopyToLive($event); @@ -744,7 +744,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteFromLive(kEvent &$event) + protected function OnBeforeDeleteFromLive(kEvent $event) { parent::OnBeforeDeleteFromLive($event); @@ -800,7 +800,7 @@ * * @param kEvent $event */ - function parentOnSave(&$event) + function parentOnSave($event) { parent::OnSave($event); } @@ -812,7 +812,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { // 1. for permission editing of Home category $this->Application->RemoveVar('IsRootCategory_' . $this->Application->GetVar('m_wid')); @@ -841,7 +841,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { // get data from live table before it is overwritten by parent OnSave method call $ids = $this->getSelectedIDs($event, true); @@ -922,7 +922,7 @@ * @return void * @access protected */ - protected function OnPreSaveCreated(kEvent &$event) + protected function OnPreSaveCreated(kEvent $event) { $object =& $event->getObject( Array ('skip_autoload' => true) ); /* @var $object CategoriesItem */ @@ -942,7 +942,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -963,7 +963,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { $ids = $event->getEventParam('ids'); @@ -1034,7 +1034,7 @@ * @return void * @access protected */ - protected function OnMassDelete(kEvent &$event) + protected function OnMassDelete(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -1094,7 +1094,7 @@ * * @param kEvent $event */ - function OnCopy(&$event) + function OnCopy($event) { $this->Application->RemoveVar('clipboard'); @@ -1110,7 +1110,7 @@ * * @param kEvent $event */ - function OnCut(&$event) + function OnCut($event) { $this->Application->RemoveVar('clipboard'); @@ -1126,7 +1126,7 @@ * * @param kEvent $event */ - function OnPasteClipboard(&$event) + function OnPasteClipboard($event) { $clipboard = unserialize( $this->Application->RecallVar('clipboard') ); foreach ($clipboard as $prefix => $clipboard_data) { @@ -1143,7 +1143,7 @@ * @param kEvent $event * @return bool */ - function _checkPastePermission(&$event) + function _checkPastePermission($event) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ @@ -1164,7 +1164,7 @@ * @return void * @access protected */ - protected function OnPaste(&$event) + protected function OnPaste($event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) || !$this->_checkPastePermission($event) ) { $event->status = kEvent::erFAIL; @@ -1244,7 +1244,7 @@ * @return void * @access protected */ - protected function _ensurePermCacheRebuild(&$event) + protected function _ensurePermCacheRebuild($event) { if ( $this->Application->ConfigValue('QuickCategoryPermissionRebuild') ) { $updater =& $this->Application->makeClass('kPermCacheUpdater'); @@ -1266,7 +1266,7 @@ * * @param kEvent $event */ - /*function OnCatPaste(&$event) + /*function OnCatPaste($event) { $inp_clipboard = $this->Application->RecallVar('ClipBoard'); $inp_clipboard = explode('-', $inp_clipboard, 2); @@ -1304,7 +1304,7 @@ * * @param kEvent $event */ - function OnClearClipboard(&$event) + function OnClearClipboard($event) { $this->Application->RemoveVar('clipboard'); } @@ -1316,7 +1316,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -1385,7 +1385,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -1406,7 +1406,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { parent::OnCreate($event); @@ -1444,7 +1444,7 @@ * @return int * @access protected */ - protected function getPerPage(kEvent &$event) + protected function getPerPage(kEvent $event) { if ( !$this->Application->isAdmin ) { $event->setEventParam('same_special', true); @@ -1461,7 +1461,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetPagination(kEvent &$event) + protected function SetPagination(kEvent $event) { parent::SetPagination($event); @@ -1488,7 +1488,7 @@ * @return void * @access protected */ - protected function iterateItems(kEvent &$event) + protected function iterateItems(kEvent $event) { if ( $event->Name != 'OnMassApprove' && $event->Name != 'OnMassDecline' ) { parent::iterateItems($event); @@ -1544,7 +1544,7 @@ * @return bool * @access protected */ - protected function checkItemStatus(kEvent &$event) + protected function checkItemStatus(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1660,7 +1660,7 @@ * * @param kEvent $event */ - function _beforeItemChange(&$event) + function _beforeItemChange($event) { $object =& $event->getObject(); /* @var $object CategoriesItem */ @@ -1767,7 +1767,7 @@ * @return void * @access protected */ - protected function OnBeforeItemDelete(kEvent &$event) + protected function OnBeforeItemDelete(kEvent $event) { parent::OnBeforeItemDelete($event); @@ -1963,7 +1963,7 @@ * * @param kEvent $event */ - function OnResetCMSMenuCache(&$event) + function OnResetCMSMenuCache($event) { if ($this->Application->GetVar('ajax') == 'yes') { $event->status = kEvent::erSTOP; @@ -2001,7 +2001,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -2103,7 +2103,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -2135,7 +2135,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -2158,7 +2158,7 @@ * * @param kEvent $event */ - function OnAfterRebuildThemes(&$event) + function OnAfterRebuildThemes($event) { $sql = 'SELECT t.ThemeId, CONCAT( tf.FilePath, \'/\', tf.FileName ) AS Path, tf.FileMetaInfo FROM '.TABLE_PREFIX.'ThemeFiles AS tf @@ -2209,7 +2209,7 @@ * * @param kEvent $event */ - function OnChangePriority(&$event) + function OnChangePriority($event) { $this->Application->SetVar('priority_prefix', $event->getPrefixSpecial()); $event->CallSubEvent('priority:' . $event->Name); @@ -2223,7 +2223,7 @@ * * @param kEvent $event */ - function OnRecalculatePriorities(&$event) + function OnRecalculatePriorities($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -2241,7 +2241,7 @@ * * @param kEvent $event */ - function OnUpdatePreviewBlock(&$event) + function OnUpdatePreviewBlock($event) { $event->status = kEvent::erSTOP; $string = kUtil::unhtmlentities($this->Application->GetVar('preview_content')); @@ -2260,7 +2260,7 @@ * * @param kEvent $event */ - function OnSimpleSearch(&$event) + function OnSimpleSearch($event) { $event->redirect = false; $search_table = TABLE_PREFIX.'ses_'.$this->Application->GetSID().'_'.TABLE_PREFIX.'Search'; @@ -2557,7 +2557,7 @@ * @return void * @access protected */ - protected function LoadItem(kEvent &$event) + protected function LoadItem(kEvent $event) { if ( $event->Special != '-virtual' ) { parent::LoadItem($event); @@ -2593,7 +2593,7 @@ * @see PriorityEventHandler * @access protected */ - protected function OnGetConstrainInfo(kEvent &$event) + protected function OnGetConstrainInfo(kEvent $event) { $constrain = ''; // for OnSave @@ -2876,7 +2876,7 @@ * @return void * @access protected */ - protected function OnAfterItemValidate(kEvent &$event) + protected function OnAfterItemValidate(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -2896,7 +2896,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(kEvent &$event) + protected function OnBeforeClone(kEvent $event) { parent::OnBeforeClone($event); Index: core/units/categories/categories_tag_processor.php =================================================================== --- core/units/categories/categories_tag_processor.php (revision 15111) +++ core/units/categories/categories_tag_processor.php (working copy) @@ -544,7 +544,7 @@ // all done, update left tree and redirect $updater->SaveData(); - $this->Application->HandleEvent($event, 'c:OnResetCMSMenuCache'); + $this->Application->HandleEvent(new kEvent('c:OnResetCMSMenuCache')); $this->Application->RemoveVar('PermCache_UpdateRequired'); $this->Application->StoreVar('RefreshStructureTree', 1); Index: core/units/category_items/category_items_event_handler.php =================================================================== --- core/units/category_items/category_items_event_handler.php (revision 15111) +++ core/units/category_items/category_items_event_handler.php (working copy) @@ -24,7 +24,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -42,7 +42,7 @@ * * @param kEvent $event */ - function OnSetPrimary(&$event) + function OnSetPrimary($event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -68,7 +68,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { if ( $event->Name == 'OnMassDelete' ) { $object =& $event->getObject(); @@ -117,7 +117,7 @@ * @return void * @access protected */ - protected function OnAfterClone(kEvent &$event) + protected function OnAfterClone(kEvent $event) { parent::OnAfterClone($event); @@ -139,7 +139,7 @@ * @return void * @access protected */ - protected function OnDeleteFromCategory(&$event) + protected function OnDeleteFromCategory($event) { $category_ids = $event->getEventParam('category_ids'); Index: core/units/config_search/config_search_event_handler.php =================================================================== --- core/units/config_search/config_search_event_handler.php (revision 15111) +++ core/units/config_search/config_search_event_handler.php (working copy) @@ -23,7 +23,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $module = $this->Application->GetVar('module'); $main_prefix = $this->Application->findModule('Name', $module, 'Var'); @@ -41,7 +41,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -63,7 +63,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -91,7 +91,7 @@ * @return void * @access protected */ - protected function OnCancel(kEvent &$event) + protected function OnCancel(kEvent $event) { parent::OnCancel($event); @@ -105,7 +105,7 @@ * @return void * @access protected */ - protected function OnCreateCustomField(&$event) + protected function OnCreateCustomField($event) { $custom_field =& $event->MasterEvent->getObject(); /* @var $custom_field kDBItem */ Index: core/units/configuration/configuration_event_handler.php =================================================================== --- core/units/configuration/configuration_event_handler.php (revision 15111) +++ core/units/configuration/configuration_event_handler.php (working copy) @@ -41,7 +41,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $event->setEventParam('PermSection', $this->Application->GetVar('section')); return parent::CheckPermission($event); @@ -55,7 +55,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -86,7 +86,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { static $default_field_options = null; @@ -187,7 +187,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { static $skin_deleted = false; @@ -241,7 +241,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -325,7 +325,7 @@ * * @param kEvent $event */ - function OnProcessSelected(&$event) + function OnProcessSelected($event) { $selected_ids = $this->Application->GetVar('selected_ids'); $this->Application->StoreVar('ModuleRootCategory', $selected_ids['c']); @@ -340,7 +340,7 @@ * @return void * @access protected */ - protected function OnGenerateMaintenancePage(kEvent &$event) + protected function OnGenerateMaintenancePage(kEvent $event) { $event->setEventParam('compile_maintenance_template', 1); Index: core/units/content/content_eh.php =================================================================== --- core/units/content/content_eh.php (revision 15111) +++ core/units/content/content_eh.php (working copy) @@ -23,7 +23,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); /* @var $perm_helper kPermissionsHelper */ @@ -42,7 +42,7 @@ * * @param kEvent $event */ - function OnSaveContentBlock(&$event) + function OnSaveContentBlock($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -61,7 +61,7 @@ * * @param kEvent $event */ - function OnAutoSave(&$event) + function OnAutoSave($event) { $event->status = kEvent::erSTOP; @@ -79,7 +79,7 @@ * @param bool $is_draft * @return string */ - function saveContentBlock(&$event, $is_draft) + function saveContentBlock($event, $is_draft) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -122,7 +122,7 @@ * * @param kEvent $event */ - function OnGetAutoSaveTime(&$event) + function OnGetAutoSaveTime($event) { $event->status = kEvent::erSTOP; @@ -160,7 +160,7 @@ $object->Load($load_keys); } - function getContentBlockAndRevision(&$event) + function getContentBlockAndRevision($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ Index: core/units/country_states/country_state_eh.php =================================================================== --- core/units/country_states/country_state_eh.php (revision 15111) +++ core/units/country_states/country_state_eh.php (working copy) @@ -42,7 +42,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -67,7 +67,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -81,7 +81,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -93,7 +93,7 @@ * * @param kEvent $event */ - function _setRequired(&$event) + function _setRequired($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -119,7 +119,7 @@ * @return void * @access protected */ - protected function OnBeforeItemDelete(kEvent &$event) + protected function OnBeforeItemDelete(kEvent $event) { parent::OnBeforeItemDelete($event); @@ -142,7 +142,7 @@ * @return void * @access protected */ - protected function OnGetStatesJSON(kEvent &$event) + protected function OnGetStatesJSON(kEvent $event) { $event->status = kEvent::erSTOP; Index: core/units/custom_data/custom_data_event_handler.php =================================================================== --- core/units/custom_data/custom_data_event_handler.php (revision 15111) +++ core/units/custom_data/custom_data_event_handler.php (working copy) @@ -22,7 +22,7 @@ * * @param kEvent $event */ - function OnDefineCustomFields(&$event) + function OnDefineCustomFields($event) { // 1. clone customdata table $clones = $this->Application->getUnitOption('cdata', 'Clones'); @@ -125,7 +125,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); Index: core/units/custom_fields/custom_fields_event_handler.php =================================================================== --- core/units/custom_fields/custom_fields_event_handler.php (revision 15111) +++ core/units/custom_fields/custom_fields_event_handler.php (working copy) @@ -23,7 +23,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $sql = 'SELECT Prefix FROM '.TABLE_PREFIX.'ItemTypes @@ -44,7 +44,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -82,7 +82,7 @@ * @param kEvent $event * @return string */ - function _getSourcePrefix(&$event) + function _getSourcePrefix($event) { $prefix = $event->getEventParam('SourcePrefix'); if (!$prefix) { @@ -102,7 +102,7 @@ * @return Array * @access protected */ - protected function _getHiddenFields(&$event) + protected function _getHiddenFields($event) { $prefix = $this->_getSourcePrefix($event); @@ -130,7 +130,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -156,7 +156,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -196,7 +196,7 @@ * @return void * @access protected */ - protected function OnSaveCustomField(&$event) + protected function OnSaveCustomField($event) { if ( $event->MasterEvent->status != kEvent::erSUCCESS ) { return ; @@ -225,7 +225,7 @@ * @return void * @access protected */ - protected function OnMassDelete(kEvent &$event) + protected function OnMassDelete(kEvent $event) { parent::OnMassDelete($event); @@ -241,7 +241,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -258,7 +258,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -311,7 +311,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); Index: core/units/email_events/email_events_event_handler.php =================================================================== --- core/units/email_events/email_events_event_handler.php (revision 15116) +++ core/units/email_events/email_events_event_handler.php (working copy) @@ -54,7 +54,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $module = $this->Application->GetVar('module'); @@ -86,7 +86,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -111,7 +111,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); @@ -135,7 +135,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -150,7 +150,7 @@ * * @param kEvent $event */ - function OnFrontOnly(&$event) + function OnFrontOnly($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -175,7 +175,7 @@ * @return void * @access protected */ - protected function OnSelectUser(kEvent &$event) + protected function OnSelectUser(kEvent $event) { if ( $event->Special != 'module' ) { parent::OnSelectUser($event); @@ -211,7 +211,7 @@ * * @param kEvent $event */ - function OnSaveSelected(&$event) + function OnSaveSelected($event) { $this->StoreSelectedIDs($event); } @@ -222,7 +222,7 @@ * @param kEvent $event * @return kDBItem */ - function &_getEmailEvent(&$event) + function &_getEmailEvent($event) { $false = false; $name = $event->getEventParam('EmailEventName'); @@ -255,7 +255,7 @@ * @param kEvent $event * @param Array $direct_params */ - function _processSender(&$event, $direct_params = Array ()) + function _processSender($event, $direct_params = Array ()) { $this->Application->removeObject('u.email-from'); @@ -331,7 +331,7 @@ * @param Array $direct_params * @return Array */ - function _processRecipients(&$event, &$direct_params = Array ()) + function _processRecipients($event, &$direct_params = Array ()) { $this->Application->removeObject('u.email-to'); @@ -556,7 +556,7 @@ * @param int $language_id * @return string */ - function _getMessageBody(&$event, $language_id = null) + function _getMessageBody($event, $language_id = null) { if (!isset($language_id)) { $language_id = $this->Application->GetVar('m_lang'); @@ -724,7 +724,7 @@ * @return void * @access protected */ - protected function OnEmailEvent(&$event) + protected function OnEmailEvent($event) { $email_event_name = $event->getEventParam('EmailEventName'); if ( strpos($email_event_name, '_') !== false ) { @@ -845,7 +845,7 @@ * @param kEvent $event * @todo Move to MailingList */ - function OnProcessEmailQueue(&$event) + function OnProcessEmailQueue($event) { $deliver_count = $event->getEventParam('deliver_count'); if ($deliver_count === false) { @@ -912,7 +912,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -943,7 +943,7 @@ * @return void * @access protected */ - protected function OnEdit(kEvent &$event) + protected function OnEdit(kEvent $event) { parent::OnEdit($event); @@ -958,7 +958,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -995,7 +995,7 @@ * * @param kEvent $event */ - function _itemChanged(&$event) + function _itemChanged($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1080,7 +1080,7 @@ * @param kEvent $event * @param string $field_prefix */ - function _validateAddress(&$event, $field_prefix) + function _validateAddress($event, $field_prefix) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1128,7 +1128,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -1142,7 +1142,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -1154,7 +1154,7 @@ * * @param kEvent $event */ - function OnSuggestAddress(&$event) + function OnSuggestAddress($event) { $event->status = kEvent::erSTOP; @@ -1249,7 +1249,7 @@ * @return void * @access protected */ - protected function OnExportEmailEvents(kEvent &$event) + protected function OnExportEmailEvents(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; Index: core/units/favorites/favorites_eh.php =================================================================== --- core/units/favorites/favorites_eh.php (revision 15111) +++ core/units/favorites/favorites_eh.php (working copy) @@ -39,7 +39,7 @@ * * @param kEvent $event */ - function OnFavoriteToggle(&$event) + function OnFavoriteToggle($event) { $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); $parent_object =& $this->Application->recallObject($parent_prefix); @@ -76,7 +76,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -99,7 +99,7 @@ * * @param kEvent $event */ - function OnDeleteFavoriteItem(&$event) + function OnDeleteFavoriteItem($event) { $main_object =& $event->MasterEvent->getObject(); Index: core/units/fck/fck_eh.php =================================================================== --- core/units/fck/fck_eh.php (revision 15111) +++ core/units/fck/fck_eh.php (working copy) @@ -41,7 +41,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $this->Application->isAdminUser || $event->Name == 'OnGetsEditorStyles' ) { // this limits all event execution only to logged-in users in admin @@ -69,7 +69,7 @@ // Create the XML document header. } - function OnLoadCmsTree(&$event) + function OnLoadCmsTree($event) { $event->status = kEvent::erSTOP; @@ -104,7 +104,7 @@ echo $res; } - function OnRenameFile(&$event) + function OnRenameFile($event) { $event->status = kEvent::erSTOP; @@ -140,7 +140,7 @@ } - function OnDeleteFiles(&$event) + function OnDeleteFiles($event) { $event->status = kEvent::erSTOP; @@ -161,7 +161,7 @@ // print_r($a_files); } - function OnGetFoldersFilesList(&$event) + function OnGetFoldersFilesList($event) { $this->CreateXmlHeader(); @@ -178,7 +178,7 @@ } - function OnCreateFolder(&$event) + function OnCreateFolder($event) { $event->status = kEvent::erSTOP; @@ -221,7 +221,7 @@ * @return void * @access protected */ - protected function OnUploadFile(kEvent &$event) + protected function OnUploadFile(kEvent $event) { $event->status = kEvent::erSTOP; @@ -240,7 +240,7 @@ * * @param kEvent $event */ - function OnGetsEditorStyles(&$event) + function OnGetsEditorStyles($event) { $minify_helper =& $this->Application->recallObject('MinifyHelper'); /* @var $minify_helper MinifyHelper */ Index: core/units/files/file_eh.php =================================================================== --- core/units/files/file_eh.php (revision 15111) +++ core/units/files/file_eh.php (working copy) @@ -41,7 +41,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -58,7 +58,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -78,7 +78,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -95,7 +95,7 @@ * * @param kEvent $event */ - function OnDownloadFile(&$event) + function OnDownloadFile($event) { $object =& $event->getObject(); /* @var $object kDBItem */ Index: core/units/filters/item_filter_eh.php =================================================================== --- core/units/filters/item_filter_eh.php (revision 15111) +++ core/units/filters/item_filter_eh.php (working copy) @@ -42,7 +42,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -87,7 +87,7 @@ * @return void * @access protected */ - protected function OnBeforeItemValidate(kEvent &$event) + protected function OnBeforeItemValidate(kEvent $event) { parent::OnBeforeItemValidate($event); @@ -123,7 +123,7 @@ * @return void * @access protected */ - protected function LoadItem(kEvent &$event) + protected function LoadItem(kEvent $event) { static $cache = null; Index: core/units/forms/drafts/draft_eh.php =================================================================== --- core/units/forms/drafts/draft_eh.php (revision 15111) +++ core/units/forms/drafts/draft_eh.php (working copy) @@ -23,7 +23,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -42,7 +42,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'related' ) { $form_submission =& $this->Application->recallObject('formsubs'); Index: core/units/forms/form_fields/form_field_eh.php =================================================================== --- core/units/forms/form_fields/form_field_eh.php (revision 15111) +++ core/units/forms/form_fields/form_field_eh.php (working copy) @@ -38,7 +38,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); Index: core/units/forms/form_submissions/form_submissions_eh.php =================================================================== --- core/units/forms/form_submissions/form_submissions_eh.php (revision 15111) +++ core/units/forms/form_submissions/form_submissions_eh.php (working copy) @@ -23,7 +23,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( !$this->Application->isAdmin ) { if ( $event->Name == 'OnCreate' ) { @@ -81,7 +81,7 @@ return $mapping[$element_type]; } - function OnBuildFormFields(&$event) + function OnBuildFormFields($event) { $form_id = $this->Application->GetVar('form_id'); if (!$form_id) return ; @@ -181,7 +181,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -198,7 +198,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'last' ) { // allow user to see his last submitted form @@ -221,7 +221,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { parent::OnCreate($event); @@ -275,7 +275,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -316,7 +316,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -333,7 +333,7 @@ * @return void * @access protected */ - protected function OnPreSaveAndGo(kEvent &$event) + protected function OnPreSaveAndGo(kEvent $event) { parent::OnPreSaveAndGo($event); @@ -350,7 +350,7 @@ * @return void * @access protected */ - protected function OnPreSaveAndGoToTab(kEvent &$event) + protected function OnPreSaveAndGoToTab(kEvent $event) { parent::OnPreSaveAndGoToTab($event); @@ -366,7 +366,7 @@ * @return void * @access protected */ - protected function OnSetPerPage(kEvent &$event) + protected function OnSetPerPage(kEvent $event) { parent::OnSetPerPage($event); @@ -380,7 +380,7 @@ * @return void * @access protected */ - protected function OnSetPage(kEvent &$event) + protected function OnSetPage(kEvent $event) { parent::OnSetPage($event); @@ -394,7 +394,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -491,7 +491,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { parent::OnUpdate($event); Index: core/units/forms/forms/forms_eh.php =================================================================== --- core/units/forms/forms/forms_eh.php (revision 15111) +++ core/units/forms/forms/forms_eh.php (working copy) @@ -35,7 +35,7 @@ $this->permMapping = array_merge($this->permMapping, $permissions); } - function OnCreateSubmissionNodes(&$event) + function OnCreateSubmissionNodes($event) { if (defined('IS_INSTALL') && IS_INSTALL) { // skip any processing, because Forms table doesn't exists until install is finished @@ -99,7 +99,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { parent::OnSave($event); @@ -118,7 +118,7 @@ * @return void * @access protected */ - protected function OnMassDelete(kEvent &$event) + protected function OnMassDelete(kEvent $event) { parent::OnMassDelete($event); @@ -129,8 +129,7 @@ function _deleteSectionCache() { - $reset_event = new kEvent('adm:OnResetSections'); - $this->Application->HandleEvent($reset_event); + $this->Application->HandleEvent(new kEvent('adm:OnResetSections')); $this->Application->StoreVar('RefreshStructureTree', 1); } @@ -140,7 +139,7 @@ * * @param kEvent $event */ - function OnCreateFormFields(&$event) + function OnCreateFormFields($event) { $cur_fields = $this->Conn->Query('DESCRIBE '.TABLE_PREFIX.'FormSubmissions', 'Field'); $cur_fields = array_keys($cur_fields); @@ -180,7 +179,7 @@ * @return void * @access protected */ - protected function OnFormSubmit(&$event) + protected function OnFormSubmit($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -242,7 +241,7 @@ if ( $field_values['MailingList'] ) { $this->Application->StoreVar('SubscriberEmail', $field_values['Email']); - $this->Application->HandleEvent($sub_event, 'u:OnSubscribeUser', Array ('no_unsubscribe' => 1)); + $this->Application->HandleEvent(new kEvent('u:OnSubscribeUser', Array ('no_unsubscribe' => 1))); } } else { @@ -257,7 +256,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -271,7 +270,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -283,7 +282,7 @@ * * @param kEvent $event */ - function itemChanged(&$event) + function itemChanged($event) { $this->_validatePopSettings($event); $this->_disableSecurityImage($event); @@ -295,7 +294,7 @@ * * @param kEvent $event */ - function _validatePopSettings(&$event) + function _validatePopSettings($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -355,7 +354,7 @@ * * @param kEvent $event */ - function _setRequired(&$event) + function _setRequired($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -378,7 +377,7 @@ * * @param kEvent $event */ - function _disableSecurityImage(&$event) + function _disableSecurityImage($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -393,7 +392,7 @@ * * @param kEvent $event */ - function OnProcessReplies(&$event) + function OnProcessReplies($event) { $this->_processMailbox($event, false); } @@ -403,7 +402,7 @@ * * @param kEvent $event */ - function OnProcessBouncedReplies(&$event) + function OnProcessBouncedReplies($event) { $this->_processMailbox($event, true); } @@ -414,7 +413,7 @@ * @param kEvent $event * @param bool $bounce_mode */ - function _processMailbox(&$event, $bounce_mode = false) + function _processMailbox($event, $bounce_mode = false) { $this->Application->SetVar('client_mode', 1); Index: core/units/forms/submission_log/submission_log_eh.php =================================================================== --- core/units/forms/submission_log/submission_log_eh.php (revision 15111) +++ core/units/forms/submission_log/submission_log_eh.php (working copy) @@ -46,7 +46,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { $section = $event->getSection(); $form_id = $this->Application->GetVar('form_id'); @@ -71,7 +71,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); @@ -204,7 +204,7 @@ * * @param kEvent $event */ - function OnResendReply(&$event) + function OnResendReply($event) { $ids = $this->StoreSelectedIDs($event); @@ -247,7 +247,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -262,7 +262,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -275,7 +275,7 @@ * * @param kEvent $event */ - function _validateRecipients(&$event) + function _validateRecipients($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -410,7 +410,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -449,7 +449,7 @@ * @param bool $from_client * @return int */ - function _getLastMessageId(&$event, $from_client = false) + function _getLastMessageId($event, $from_client = false) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -475,7 +475,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -497,7 +497,7 @@ * * @param kEvent $event */ - function _updateStatusDates(&$event) + function _updateStatusDates($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -547,7 +547,7 @@ * * @param kEvent $event */ - function _updateSubmission(&$event) + function _updateSubmission($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -593,7 +593,7 @@ * * @param kEvent $event */ - function OnSaveDraft(&$event) + function OnSaveDraft($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -636,7 +636,7 @@ * * @param kEvent $event */ - function OnUseDraft(&$event) + function OnUseDraft($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -673,7 +673,7 @@ * * @param kEvent $event */ - function OnDeleteDraft(&$event) + function OnDeleteDraft($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ Index: core/units/groups/groups_event_handler.php =================================================================== --- core/units/groups/groups_event_handler.php (revision 15111) +++ core/units/groups/groups_event_handler.php (working copy) @@ -24,7 +24,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -61,7 +61,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { parent::OnSave($event); Index: core/units/helpers/ajax_form_helper.php =================================================================== --- core/units/helpers/ajax_form_helper.php (revision 15111) +++ core/units/helpers/ajax_form_helper.php (working copy) @@ -9,7 +9,7 @@ * @param kEvent $event * @param Array $response */ - public function prepareJSONErrors(&$event, &$response) + public function prepareJSONErrors($event, &$response) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -51,7 +51,7 @@ * @param kEvent $event * @param Array $response */ - public function sendResponse(&$event, $response) + public function sendResponse($event, $response) { $json_helper =& $this->Application->recallObject('JSONHelper'); /* @var $json_helper JSONHelper */ @@ -68,7 +68,7 @@ * @param string $call_event * @param Array $params */ - public function transitEvent(&$event, $call_event, $params = Array ()) + public function transitEvent($event, $call_event, $params = Array ()) { $params['status'] = 'OK'; $event->CallSubEvent($call_event); Index: core/units/helpers/brackets_helper.php =================================================================== --- core/units/helpers/brackets_helper.php (revision 15111) +++ core/units/helpers/brackets_helper.php (working copy) @@ -102,7 +102,7 @@ * @param kEvent $event * @return Array */ - function getBrackets(&$event) + function getBrackets($event) { $items_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); @@ -134,7 +134,7 @@ * @param kEvent $event * @param Array $brackets */ - function setBrackets(&$event, $brackets) + function setBrackets($event, $brackets) { $brackets = $this->formatBrackets($brackets); @@ -165,7 +165,7 @@ * * @param kEvent $event */ - function OnMoreBrackets(&$event) + function OnMoreBrackets($event) { $field_values = $this->getBrackets($event); @@ -209,7 +209,7 @@ * * @param kEvent $event */ - function OnInfinity(&$event) + function OnInfinity($event) { $object =& $event->getObject(); $infinite_exists = $this->Conn->GetOne('SELECT COUNT(*) FROM '.$object->TableName.' WHERE '.$this->max_field.' = -1'); @@ -252,7 +252,7 @@ * * @param kEvent $event */ - function OnPreSaveBrackets(&$event) + function OnPreSaveBrackets($event) { $items_info = $this->getBrackets($event); if ($items_info) { @@ -312,7 +312,7 @@ * @param kEvent $event * @return Array */ - function arrangeBrackets(&$event) + function arrangeBrackets($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -463,7 +463,7 @@ * * @param kEvent $event */ - function replaceInfinity(&$event) + function replaceInfinity($event) { $object =& $event->getObject(); /* @var $object kDBItem */ Index: core/units/helpers/captcha_helper.php =================================================================== --- core/units/helpers/captcha_helper.php (revision 15111) +++ core/units/helpers/captcha_helper.php (working copy) @@ -151,7 +151,7 @@ * @param bool $check_request * @return bool */ - function validateCode(&$event, $check_request = true) + function validateCode($event, $check_request = true) { if ($this->Application->isAdmin) { // no captcha codes in admin Index: core/units/helpers/cat_dbitem_export_helper.php =================================================================== --- core/units/helpers/cat_dbitem_export_helper.php (revision 15127) +++ core/units/helpers/cat_dbitem_export_helper.php (working copy) @@ -155,7 +155,7 @@ * @param kCatDBItem|bool $object * @param bool $set_status */ - function fillRequiredFields(&$event, &$object, $set_status = false) + function fillRequiredFields($event, &$object, $set_status = false) { if ( $object == $this->false ) { $object =& $event->getObject(); @@ -212,7 +212,7 @@ * @return bool * @access protected */ - protected function verifyOptions(&$event) + protected function verifyOptions($event) { if ($this->Application->RecallVar($event->getPrefixSpecial().'_ForceNotValid')) { @@ -398,7 +398,7 @@ * * @param kEvent $event */ - function openFile(&$event) + function openFile($event) { $file_helper =& $this->Application->recallObject('FileHelper'); /* @var $file_helper FileHelper */ @@ -543,7 +543,7 @@ * * @param kEvent $event */ - function performExport(&$event) + function performExport($event) { $this->exportOptions = $this->loadOptions($event); $this->exportFields = $this->exportOptions['ExportColumns']; @@ -638,7 +638,7 @@ * * @param kEvent $event */ - function performImport(&$event) + function performImport($event) { if (!$this->exportOptions) { // load import options in case if not previously loaded in verification function @@ -769,7 +769,7 @@ * @param Array $record_data * @return void */ - function resetImportObject(&$event, $object_type, $record_data = null) + function resetImportObject($event, $object_type, $record_data = null) { switch ($object_type) { case IMPORT_TEMP: @@ -868,7 +868,7 @@ * @param Array $record_data * @return bool */ - function processCurrentItem(&$event, $record_data) + function processCurrentItem($event, $record_data) { $save_method = 'Create'; $load_keys = Array(); @@ -1220,7 +1220,7 @@ * @param Array $options * @return void */ - function saveOptions(&$event, $options = null) + function saveOptions($event, $options = null) { if ( !isset($options) ) { $options = $this->exportOptions; @@ -1235,7 +1235,7 @@ * @param kEvent $event * @return Array */ - function loadOptions(&$event) + function loadOptions($event) { return unserialize( $this->Application->RecallVar($event->getPrefixSpecial() . '_options') ); } @@ -1245,7 +1245,7 @@ * * @param kEvent $event */ - function prepareExportColumns(&$event) + function prepareExportColumns($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kCatDBItem */ @@ -1332,7 +1332,7 @@ * @param kEvent $event * @return void */ - function PrepareExportPresets(&$event) + function PrepareExportPresets($event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -1381,7 +1381,7 @@ * @return void * @access protected */ - protected function updateImportFiles(&$event) + protected function updateImportFiles($event) { if ( $event->Special != 'import' ) { return ; @@ -1418,7 +1418,7 @@ * @param kEvent $event * @return string */ - function getModuleName(&$event) + function getModuleName($event) { $module_path = $this->Application->getUnitOption($event->Prefix, 'ModuleFolder') . '/'; $module_name = $this->Application->findModule('Path', $module_path, 'Name'); @@ -1431,7 +1431,7 @@ * * @param kEvent $event */ - function OnExportBegin(&$event) + function OnExportBegin($event) { $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); @@ -1536,7 +1536,7 @@ * * @param kEvent $event */ - function setRequiredFields(&$event) + function setRequiredFields($event) { $required_fields['common'] = Array('FieldsSeparatedBy', 'LineEndings', 'CategoryFormat'); Index: core/units/helpers/clipboard_helper.php =================================================================== --- core/units/helpers/clipboard_helper.php (revision 15111) +++ core/units/helpers/clipboard_helper.php (working copy) @@ -23,7 +23,7 @@ * @param string $mode * @param Array $ids */ - function setClipboard(&$event, $mode, $ids) + function setClipboard($event, $mode, $ids) { // clipboard = { prefix1 = { cut = {idsA}, copy = {idsB} }, ... prefixN = { cut = {idsC}, copy = {idsD} } } $object = $event->getObject(); Index: core/units/helpers/controls/controls_config.php =================================================================== --- core/units/helpers/controls/controls_config.php (revision 15111) +++ core/units/helpers/controls/controls_config.php (working copy) @@ -19,7 +19,7 @@ 'EventHandlerClass' => Array('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), 'RegisterClasses' => Array( - Array('pseudo'=>'MInputHelper','class'=>'MInputHelper','file'=>'minput_helper.php','build_event'=>'','require_classes'=>'kHelper'), - Array('pseudo' => 'EditPickerHelper', 'class' => 'EditPickerHelper', 'file' => 'edit_picker_helper.php', 'build_event' => '', 'require_classes' => Array('kHelper')), + Array('pseudo' => 'MInputHelper', 'class' => 'MInputHelper', 'file' => 'minput_helper.php', 'build_event' => ''), + Array('pseudo' => 'EditPickerHelper', 'class' => 'EditPickerHelper', 'file' => 'edit_picker_helper.php', 'build_event' => ''), ), ); \ No newline at end of file Index: core/units/helpers/controls/edit_picker_helper.php =================================================================== --- core/units/helpers/controls/edit_picker_helper.php (revision 15111) +++ core/units/helpers/controls/edit_picker_helper.php (working copy) @@ -30,7 +30,7 @@ * @param kEvent $event * @param string $storage_field main item's field name, where values are located */ - function applyFilter(&$event, $storage_field) + function applyFilter($event, $storage_field) { if ($event->Special != 'selected' && $event->Special != 'available') { return ; @@ -72,7 +72,7 @@ * @param string $store_field main item's field name, to store values into * @param string $source_field prefix and it's field used to store info about selected items (format: prefix.field) */ - function LoadValues(&$event, $store_field, $source_field) + function LoadValues($event, $store_field, $source_field) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -160,7 +160,7 @@ /** * Returns constrain for picker options query - * + * * @param kDBItem $object * @param string $store_field * @param string $mode Index: core/units/helpers/controls/minput_helper.php =================================================================== --- core/units/helpers/controls/minput_helper.php (revision 15111) +++ core/units/helpers/controls/minput_helper.php (working copy) @@ -77,7 +77,7 @@ * * @param kEvent $event */ - function OnValidateMInputFields(&$event) + function OnValidateMInputFields($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -147,7 +147,7 @@ * @param string $sub_prefix prefix used to store info about selected items * @param Array $use_fields fields, used in value string building */ - function LoadValues(&$event, $store_field, $sub_prefix, $use_fields) + function LoadValues($event, $store_field, $sub_prefix, $use_fields) { $object =& $event->getObject(); /* @var $object kDBItem */ Index: core/units/helpers/country_states_helper.php =================================================================== --- core/units/helpers/country_states_helper.php (revision 15111) +++ core/units/helpers/country_states_helper.php (working copy) @@ -56,7 +56,7 @@ * @param string $state_field * @param string $country_field */ - function PopulateStates(&$event, $state_field, $country_field) + function PopulateStates($event, $state_field, $country_field) { static $cache = Array (); @@ -155,7 +155,7 @@ * @param bool $auto_required * @return void */ - function CheckStateField(&$event, $state_field, $country_field, $auto_required = true) + function CheckStateField($event, $state_field, $country_field, $auto_required = true) { $object =& $event->getObject(); /* @var $object kDBItem */ Index: core/units/helpers/deployment_helper.php =================================================================== --- core/units/helpers/deployment_helper.php (revision 15120) +++ core/units/helpers/deployment_helper.php (working copy) @@ -243,14 +243,12 @@ { // 2. reset unit config cache (so new classes get auto-registered) echo 'Resetting Unit Config Cache ... '; - $admin_event = new kEvent('adm:OnResetConfigsCache'); - $this->Application->HandleEvent($admin_event); + $this->Application->HandleEvent(new kEvent('adm:OnResetConfigsCache')); $this->displayStatus('OK'); // 3. reset sections cache echo 'Resetting Sections Cache ... '; - $admin_event = new kEvent('adm:OnResetSections'); - $this->Application->HandleEvent($admin_event); + $this->Application->HandleEvent(new kEvent('adm:OnResetSections')); $this->displayStatus('OK'); } @@ -263,8 +261,7 @@ private function refreshThemes() { echo 'Rebuilding Theme Files ... '; - $admin_event = new kEvent('adm:OnRebuildThemes'); - $this->Application->HandleEvent($admin_event); + $this->Application->HandleEvent(new kEvent('adm:OnRebuildThemes')); $this->displayStatus('OK'); } Index: core/units/helpers/helpers_config.php =================================================================== --- core/units/helpers/helpers_config.php (revision 15111) +++ core/units/helpers/helpers_config.php (working copy) @@ -20,56 +20,56 @@ 'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), 'RegisterClasses' => Array ( - Array ('pseudo' => 'kMultiLanguageHelper', 'class' => 'kMultiLanguageHelper', 'file' => 'multilanguage_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'SearchHelper', 'class' => 'kSearchHelper', 'file' => 'search_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'SectionsHelper', 'class' => 'kSectionsHelper', 'file' => 'sections_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'PermissionsHelper', 'class' => 'kPermissionsHelper', 'file' => 'permissions_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'ModulesHelper', 'class' => 'kModulesHelper', 'file' => 'modules_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CategoryItemRewrite', 'class' => 'CategoryItemRewrite', 'file' => 'mod_rewrite_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'RecursiveHelper', 'class' => 'kRecursiveHelper', 'file' => 'recursive_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'FilenamesHelper', 'class' => 'kFilenamesHelper', 'file' => 'filenames_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'ClipboardHelper', 'class' => 'kClipboardHelper', 'file' => 'clipboard_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'ColumnPickerHelper', 'class' => 'kColumnPickerHelper', 'file' => 'col_picker_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'ThemesHelper', 'class' => 'kThemesHelper', 'file' => 'themes_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CaptchaHelper', 'class' => 'kCaptchaHelper', 'file' => 'captcha_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'PriorityHelper', 'class' => 'kPriorityHelper', 'file' => 'priority_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CurlHelper', 'class' => 'kCurlHelper', 'file' => 'curl_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CountHelper', 'class' => 'kCountHelper', 'file' => 'count_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), + Array ('pseudo' => 'kMultiLanguageHelper', 'class' => 'kMultiLanguageHelper', 'file' => 'multilanguage_helper.php', 'build_event' => ''), + Array ('pseudo' => 'SearchHelper', 'class' => 'kSearchHelper', 'file' => 'search_helper.php', 'build_event' => ''), + Array ('pseudo' => 'SectionsHelper', 'class' => 'kSectionsHelper', 'file' => 'sections_helper.php', 'build_event' => ''), + Array ('pseudo' => 'PermissionsHelper', 'class' => 'kPermissionsHelper', 'file' => 'permissions_helper.php', 'build_event' => ''), + Array ('pseudo' => 'ModulesHelper', 'class' => 'kModulesHelper', 'file' => 'modules_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CategoryItemRewrite', 'class' => 'CategoryItemRewrite', 'file' => 'mod_rewrite_helper.php', 'build_event' => ''), + Array ('pseudo' => 'RecursiveHelper', 'class' => 'kRecursiveHelper', 'file' => 'recursive_helper.php', 'build_event' => ''), + Array ('pseudo' => 'FilenamesHelper', 'class' => 'kFilenamesHelper', 'file' => 'filenames_helper.php', 'build_event' => ''), + Array ('pseudo' => 'ClipboardHelper', 'class' => 'kClipboardHelper', 'file' => 'clipboard_helper.php', 'build_event' => ''), + Array ('pseudo' => 'ColumnPickerHelper', 'class' => 'kColumnPickerHelper', 'file' => 'col_picker_helper.php', 'build_event' => ''), + Array ('pseudo' => 'ThemesHelper', 'class' => 'kThemesHelper', 'file' => 'themes_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CaptchaHelper', 'class' => 'kCaptchaHelper', 'file' => 'captcha_helper.php', 'build_event' => ''), + Array ('pseudo' => 'PriorityHelper', 'class' => 'kPriorityHelper', 'file' => 'priority_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CurlHelper', 'class' => 'kCurlHelper', 'file' => 'curl_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CountHelper', 'class' => 'kCountHelper', 'file' => 'count_helper.php', 'build_event' => ''), - Array ('pseudo' => 'ImageHelper', 'class' => 'ImageHelper', 'file' => 'image_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'FileHelper', 'class' => 'FileHelper', 'file' => 'file_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CategoryHelper', 'class' => 'CategoryHelper', 'file' => 'category_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CSVHelper', 'class' => 'kCSVHelper', 'file' => 'csv_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'ChartHelper', 'class' => 'kChartHelper', 'file' => 'chart_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'RatingHelper', 'class' => 'RatingHelper', 'file' => 'rating_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'FCKHelper', 'class' => 'fckFCKHelper', 'file' => 'fck_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'SpamHelper', 'class' => 'SpamHelper', 'file' => 'spam_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'TemplateHelper', 'class' => 'TemplateHelper', 'file' => 'template_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'MailingListHelper', 'class' => 'MailingListHelper', 'file' => 'mailing_list_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'JSONHelper', 'class' => 'JSONHelper', 'file' => 'json_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'LanguageImportHelper', 'class' => 'LanguageImportHelper', 'file' => 'language_import_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'SkinHelper', 'class' => 'SkinHelper', 'file' => 'skin_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'SiteConfigHelper', 'class' => 'SiteConfigHelper', 'file' => 'site_config_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'MenuHelper', 'class' => 'MenuHelper', 'file' => 'menu_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), + Array ('pseudo' => 'ImageHelper', 'class' => 'ImageHelper', 'file' => 'image_helper.php', 'build_event' => ''), + Array ('pseudo' => 'FileHelper', 'class' => 'FileHelper', 'file' => 'file_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CategoryHelper', 'class' => 'CategoryHelper', 'file' => 'category_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CSVHelper', 'class' => 'kCSVHelper', 'file' => 'csv_helper.php', 'build_event' => ''), + Array ('pseudo' => 'ChartHelper', 'class' => 'kChartHelper', 'file' => 'chart_helper.php', 'build_event' => ''), + Array ('pseudo' => 'RatingHelper', 'class' => 'RatingHelper', 'file' => 'rating_helper.php', 'build_event' => ''), + Array ('pseudo' => 'FCKHelper', 'class' => 'fckFCKHelper', 'file' => 'fck_helper.php', 'build_event' => ''), + Array ('pseudo' => 'SpamHelper', 'class' => 'SpamHelper', 'file' => 'spam_helper.php', 'build_event' => ''), + Array ('pseudo' => 'TemplateHelper', 'class' => 'TemplateHelper', 'file' => 'template_helper.php', 'build_event' => ''), + Array ('pseudo' => 'MailingListHelper', 'class' => 'MailingListHelper', 'file' => 'mailing_list_helper.php', 'build_event' => ''), + Array ('pseudo' => 'JSONHelper', 'class' => 'JSONHelper', 'file' => 'json_helper.php', 'build_event' => ''), + Array ('pseudo' => 'LanguageImportHelper', 'class' => 'LanguageImportHelper', 'file' => 'language_import_helper.php', 'build_event' => ''), + Array ('pseudo' => 'SkinHelper', 'class' => 'SkinHelper', 'file' => 'skin_helper.php', 'build_event' => ''), + Array ('pseudo' => 'SiteConfigHelper', 'class' => 'SiteConfigHelper', 'file' => 'site_config_helper.php', 'build_event' => ''), + Array ('pseudo' => 'MenuHelper', 'class' => 'MenuHelper', 'file' => 'menu_helper.php', 'build_event' => ''), - Array ('pseudo' => 'InpCustomFieldsHelper', 'class' => 'InpCustomFieldsHelper', 'file' => 'custom_fields_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CountryStatesHelper', 'class' => 'kCountryStatesHelper', 'file' => 'country_states_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'BracketsHelper', 'class' => 'kBracketsHelper', 'file' => 'brackets_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'kXMLHelper', 'class' => 'kXMLHelper', 'file' => 'xml_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'CatItemExportHelper', 'class' => 'kCatDBItemExportHelper', 'file' => 'cat_dbitem_export_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'EmailMessageHelper', 'class' => 'EmailMessageHelper', 'file' => 'email_message_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'ListHelper', 'class' => 'ListHelper', 'file' => 'list_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), + Array ('pseudo' => 'InpCustomFieldsHelper', 'class' => 'InpCustomFieldsHelper', 'file' => 'custom_fields_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CountryStatesHelper', 'class' => 'kCountryStatesHelper', 'file' => 'country_states_helper.php', 'build_event' => ''), + Array ('pseudo' => 'BracketsHelper', 'class' => 'kBracketsHelper', 'file' => 'brackets_helper.php', 'build_event' => ''), + Array ('pseudo' => 'kXMLHelper', 'class' => 'kXMLHelper', 'file' => 'xml_helper.php', 'build_event' => ''), + Array ('pseudo' => 'CatItemExportHelper', 'class' => 'kCatDBItemExportHelper', 'file' => 'cat_dbitem_export_helper.php', 'build_event' => ''), + Array ('pseudo' => 'EmailMessageHelper', 'class' => 'EmailMessageHelper', 'file' => 'email_message_helper.php', 'build_event' => ''), + Array ('pseudo' => 'ListHelper', 'class' => 'ListHelper', 'file' => 'list_helper.php', 'build_event' => ''), - Array ('pseudo' => 'FormSubmissionHelper', 'class' => 'FormSubmissionHelper', 'file' => 'form_submission_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'MailboxHelper', 'class' => 'MailboxHelper', 'file' => 'mailbox_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'POP3Helper', 'class' => 'POP3Helper', 'file' => 'pop3_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'MimeDecodeHelper', 'class' => 'MimeDecodeHelper', 'file' => 'mime_decode_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'UserHelper', 'class' => 'UserHelper', 'file' => 'user_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'SiteHelper', 'class' => 'SiteHelper', 'file' => 'site_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), + Array ('pseudo' => 'FormSubmissionHelper', 'class' => 'FormSubmissionHelper', 'file' => 'form_submission_helper.php', 'build_event' => ''), + Array ('pseudo' => 'MailboxHelper', 'class' => 'MailboxHelper', 'file' => 'mailbox_helper.php', 'build_event' => ''), + Array ('pseudo' => 'POP3Helper', 'class' => 'POP3Helper', 'file' => 'pop3_helper.php', 'build_event' => ''), + Array ('pseudo' => 'MimeDecodeHelper', 'class' => 'MimeDecodeHelper', 'file' => 'mime_decode_helper.php', 'build_event' => ''), + Array ('pseudo' => 'UserHelper', 'class' => 'UserHelper', 'file' => 'user_helper.php', 'build_event' => ''), + Array ('pseudo' => 'SiteHelper', 'class' => 'SiteHelper', 'file' => 'site_helper.php', 'build_event' => ''), - Array ('pseudo' => 'DeploymentHelper', 'class' => 'DeploymentHelper', 'file' => 'deployment_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'PageHelper', 'class' => 'PageHelper', 'file' => 'page_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), + Array ('pseudo' => 'DeploymentHelper', 'class' => 'DeploymentHelper', 'file' => 'deployment_helper.php', 'build_event' => ''), + Array ('pseudo' => 'PageHelper', 'class' => 'PageHelper', 'file' => 'page_helper.php', 'build_event' => ''), Array ('pseudo' => 'BackupHelper', 'class' => 'BackupHelper', 'file' => 'backup_helper.php', 'build_event' => ''), - Array ('pseudo' => 'AjaxFormHelper', 'class' => 'AjaxFormHelper', 'file' => 'ajax_form_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), + Array ('pseudo' => 'AjaxFormHelper', 'class' => 'AjaxFormHelper', 'file' => 'ajax_form_helper.php', 'build_event' => ''), ), ); \ No newline at end of file Index: core/units/helpers/minifiers/minifiers_config.php =================================================================== --- core/units/helpers/minifiers/minifiers_config.php (revision 15111) +++ core/units/helpers/minifiers/minifiers_config.php (working copy) @@ -19,8 +19,8 @@ 'EventHandlerClass' => Array ('class' => 'kEventHandler', 'file' => '', 'build_event' => 'OnBuild'), 'RegisterClasses' => Array ( - Array ('pseudo' => 'CssMinifyHelper', 'class' => 'CssMinifyHelper', 'file' => 'css_minify_helper.php', 'build_event' => '', 'require_classes' => 'kHelper'), - Array ('pseudo' => 'JsMinifyHelper', 'class' => 'JsMinifyHelper', 'file' => 'js_minify_helper.php', 'build_event' => '', 'require_classes' => Array ('kHelper')), - Array ('pseudo' => 'MinifyHelper', 'class' => 'MinifyHelper', 'file' => 'minify_helper.php', 'build_event' => '', 'require_classes' => Array ('kHelper')), + Array ('pseudo' => 'CssMinifyHelper', 'class' => 'CssMinifyHelper', 'file' => 'css_minify_helper.php', 'build_event' => ''), + Array ('pseudo' => 'JsMinifyHelper', 'class' => 'JsMinifyHelper', 'file' => 'js_minify_helper.php', 'build_event' => ''), + Array ('pseudo' => 'MinifyHelper', 'class' => 'MinifyHelper', 'file' => 'minify_helper.php', 'build_event' => ''), ), ); \ No newline at end of file Index: core/units/helpers/permissions_helper.php =================================================================== --- core/units/helpers/permissions_helper.php (revision 15111) +++ core/units/helpers/permissions_helper.php (working copy) @@ -69,7 +69,7 @@ * @param Array $perm_mapping * @return Array */ - function getPermissionByEvent(&$event, $perm_mapping) + function getPermissionByEvent($event, $perm_mapping) { $top_prefix = $event->getEventParam('top_prefix'); @@ -95,7 +95,7 @@ * @param Array $perm_mapping * @return bool */ - function CheckEventPermission(&$event, $perm_mapping) + function CheckEventPermission($event, $perm_mapping) { $section = $event->getSection(); if (preg_match('/^CATEGORY:(.*)/', $section)) { @@ -175,7 +175,7 @@ * @param Array $event_perm_mapping * @return bool */ - function _frontCheckEventCategoryPermission(&$event, $event_perm_mapping) + function _frontCheckEventCategoryPermission($event, $event_perm_mapping) { // mapping between specific permissions and common permissions static $perm_mapping = Array( @@ -278,7 +278,7 @@ * @param bool $perm_status * @return bool */ - function finalizePermissionCheck(&$event, $perm_status) + function finalizePermissionCheck($event, $perm_status) { if (!$perm_status) { if (MOD_REWRITE) { @@ -311,7 +311,7 @@ * @param bool $new_item * @return mixed */ - function checkCombinedPermissions(&$event, $owner_id, $category_id, $new_item = false) + function checkCombinedPermissions($event, $owner_id, $category_id, $new_item = false) { $ret = null; // true/false when used, null when not used $top_prefix = $event->getEventParam('top_prefix'); @@ -359,7 +359,7 @@ * @param Array $event_perm_mapping * @return mixed */ - function CheckEventCategoryPermission(&$event, $event_perm_mapping) + function CheckEventCategoryPermission($event, $event_perm_mapping) { if (!$this->Application->isAdmin) { // check front-end permission by old scheme Index: core/units/helpers/priority_helper.php =================================================================== --- core/units/helpers/priority_helper.php (revision 15111) +++ core/units/helpers/priority_helper.php (working copy) @@ -25,7 +25,7 @@ * @param string $joins left joins, used by constrain (if any) * */ - function preparePriorities(&$event, $is_new = false, $constrain = '', $joins = '') + function preparePriorities($event, $is_new = false, $constrain = '', $joins = '') { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -82,7 +82,7 @@ * @param string $joins * @return Array */ - function updatePriorities(&$event, $changes, $new_ids, $constrain = '', $joins = '') + function updatePriorities($event, $changes, $new_ids, $constrain = '', $joins = '') { // TODO: no need pass external $constrain, since the one from $pair is used @@ -178,7 +178,7 @@ * @param string $joins * @return Array */ - function recalculatePriorities(&$event, $constrain = '', $joins = '') + function recalculatePriorities($event, $constrain = '', $joins = '') { $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); Index: core/units/helpers/search_helper.php =================================================================== --- core/units/helpers/search_helper.php (revision 15113) +++ core/units/helpers/search_helper.php (working copy) @@ -214,7 +214,7 @@ * @return void * @access public */ - public function performSearch(&$event) + public function performSearch($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -243,7 +243,7 @@ * @param Array $custom_filter * @return void */ - function processAutomaticFilters(&$event, $search_keyword, $custom_filter) + function processAutomaticFilters($event, $search_keyword, $custom_filter) { $grid_name = $this->Application->GetVar('grid_name'); $grids = $this->Application->getUnitOption($event->Prefix, 'Grids'); @@ -408,7 +408,7 @@ * @param kEvent $event * @return Array|bool */ - function processCustomFilters(&$event) + function processCustomFilters($event) { $grid_name = $this->Application->GetVar('grid_name'); @@ -729,7 +729,7 @@ * * @param kEvent $event */ - function resetSearch(&$event) + function resetSearch($event) { $this->Application->RemoveVar($event->getPrefixSpecial().'_search_filter'); $this->Application->RemoveVar($event->getPrefixSpecial().'_search_keyword'); @@ -746,7 +746,7 @@ * @param string $types * @param string $except_types */ - function SetComplexFilter(&$event, &$type_clauses, $types, $except_types) + function SetComplexFilter($event, &$type_clauses, $types, $except_types) { $includes_or_filter =& $this->Application->makeClass('kMultipleFilter', Array (kDBList::FLT_TYPE_OR)); /* @var $includes_or_filter kMultipleFilter */ Index: core/units/helpers/user_helper.php =================================================================== --- core/units/helpers/user_helper.php (revision 15111) +++ core/units/helpers/user_helper.php (working copy) @@ -175,7 +175,7 @@ $this->Application->StorePersistentVar('ThisLogin', adodb_mktime()); } - $this->Application->HandleEvent($dummy, 'u:OnAfterLogin'); + $this->Application->HandleEvent(new kEvent('u:OnAfterLogin')); } /** @@ -276,7 +276,7 @@ $sync_manager->performAction('LogoutUser'); - $this->Application->HandleEvent($dummy, 'u:OnBeforeLogout'); + $this->Application->HandleEvent(new kEvent('u:OnBeforeLogout')); $user_id = USER_GUEST; $this->Application->SetVar('u.current_id', $user_id); Index: core/units/images/image_event_handler.php =================================================================== --- core/units/images/image_event_handler.php (revision 15111) +++ core/units/images/image_event_handler.php (working copy) @@ -65,7 +65,7 @@ * @return string * @access protected */ - protected function getMainSpecial(kEvent &$event) + protected function getMainSpecial(kEvent $event) { if ( $event->Special == 'list' && !$this->Application->isAdmin ) { // ListImages aggregated tag uses this special @@ -83,7 +83,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -149,7 +149,7 @@ * @return void * @access protected */ - protected function ImageAction(&$event) + protected function ImageAction($event) { $id = $event->getEventParam('id'); @@ -249,7 +249,7 @@ * @return void * @access protected */ - protected function OnSetPrimary(&$event) + protected function OnSetPrimary($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -265,7 +265,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -279,7 +279,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -296,7 +296,7 @@ * * @param kEvent $event */ - function processImageStatus(&$event) + function processImageStatus($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -330,7 +330,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -370,7 +370,7 @@ * @param kEvent $event * @return Array */ - function getTypeClauses(&$event) + function getTypeClauses($event) { $type_clauses = Array (); @@ -386,7 +386,7 @@ * * @param kEvent $event */ - function OnCleanImages(&$event) + function OnCleanImages($event) { // 1. get images, that are currently in use $active_images = $this->_getActiveImages( $this->Application->getUnitOption('img', 'TableName') ); @@ -477,7 +477,7 @@ * * @param kEvent $event */ - function OnCleanResizedImages(&$event) + function OnCleanResizedImages($event) { $images = glob(FULL_PATH . IMAGES_PATH . 'resized/*.*'); if ($images) { Index: core/units/languages/languages_event_handler.php =================================================================== --- core/units/languages/languages_event_handler.php (revision 15116) +++ core/units/languages/languages_event_handler.php (working copy) @@ -47,7 +47,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnItemBuild' ) { // check permission without using $event->getSection(), @@ -65,7 +65,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'primary' ) { return $this->Application->GetDefaultLanguageId(); @@ -79,7 +79,7 @@ * * @param kEvent $event */ - function OnReflectMultiLingualFields(&$event) + function OnReflectMultiLingualFields($event) { if ($this->Application->GetVar('ajax') == 'yes') { $event->status = kEvent::erSTOP; @@ -109,7 +109,7 @@ * * @param kEvent $event */ - function OnSetPrimary(&$event) + function OnSetPrimary($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -133,7 +133,7 @@ * * @param kEvent $event */ - function OnUpdatePrimary(&$event) + function OnUpdatePrimary($event) { if ($event->MasterEvent->status != kEvent::erSUCCESS) { return ; @@ -184,7 +184,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -217,7 +217,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -240,7 +240,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -275,7 +275,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -308,7 +308,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { parent::OnSave($event); @@ -359,7 +359,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -384,7 +384,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteFromLive(kEvent &$event) + protected function OnBeforeDeleteFromLive(kEvent $event) { parent::OnBeforeDeleteFromLive($event); @@ -400,7 +400,7 @@ } } - function OnChangeLanguage(&$event) + function OnChangeLanguage($event) { $language_id = $this->Application->GetVar('language'); $language_field = $this->Application->isAdmin ? 'AdminLanguage' : 'FrontLanguage'; @@ -431,7 +431,7 @@ * * @param kEvent $event */ - function OnImportLanguage(&$event) + function OnImportLanguage($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -482,7 +482,7 @@ * * @param kEvent $event */ - function OnExportLanguage(&$event) + function OnExportLanguage($event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -508,7 +508,7 @@ * * @param kEvent $event */ - function OnExportProgress(&$event) + function OnExportProgress($event) { $items_info = $this->Application->GetVar('phrases_export'); if ( $items_info ) { @@ -575,12 +575,12 @@ * @return void * @access protected */ - protected function OnGoBack(kEvent &$event) + protected function OnGoBack(kEvent $event) { $event->SetRedirectParam('opener', 'u'); } - function OnScheduleTopFrameReload(&$event) + function OnScheduleTopFrameReload($event) { $this->Application->StoreVar('RefreshTopFrame',1); } @@ -592,7 +592,7 @@ * @return void * @access protected */ - protected function OnBeforeItemDelete(kEvent &$event) + protected function OnBeforeItemDelete(kEvent $event) { parent::OnBeforeItemDelete($event); @@ -611,7 +611,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -641,7 +641,7 @@ * @return void * @access protected */ - protected function OnSynchronizeLanguages(&$event) + protected function OnSynchronizeLanguages($event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; Index: core/units/logs/change_logs/change_log_eh.php =================================================================== --- core/units/logs/change_logs/change_log_eh.php (revision 15111) +++ core/units/logs/change_logs/change_log_eh.php (working copy) @@ -41,7 +41,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -59,7 +59,7 @@ * * @param kEvent $event */ - function OnEnableLog(&$event) + function OnEnableLog($event) { $this->Application->SetConfigValue('UseChangeLog', 1); } Index: core/units/logs/change_logs/change_logs_config.php =================================================================== --- core/units/logs/change_logs/change_logs_config.php (revision 15111) +++ core/units/logs/change_logs/change_logs_config.php (working copy) @@ -22,7 +22,7 @@ 'TagProcessorClass' => Array ('class' => 'ChangeLogTagProcessor', 'file' => 'change_log_tp.php', 'build_event' => 'OnBuild'), 'RegisterClasses' => Array ( - Array ('pseudo' => 'kChangesFormatter', 'class' => 'kChangesFormatter', 'file' => 'changes_formatter.php', 'build_event' => '', 'require_classes' => 'kFormatter'), + Array ('pseudo' => 'kChangesFormatter', 'class' => 'kChangesFormatter', 'file' => 'changes_formatter.php', 'build_event' => ''), ), 'AutoLoad' => true, Index: core/units/logs/session_logs/session_log_eh.php =================================================================== --- core/units/logs/session_logs/session_log_eh.php (revision 15111) +++ core/units/logs/session_logs/session_log_eh.php (working copy) @@ -21,7 +21,7 @@ * * @param kEvent $event */ - function OnStartSession(&$event) + function OnStartSession($event) { if (!$this->Application->ConfigValue('UseChangeLog')) { // don't use session log when change log is disabled @@ -53,7 +53,7 @@ * * @param kEvent $event */ - function OnEndSession(&$event) + function OnEndSession($event) { $object =& $this->Application->recallObject($event->Prefix, null, Array ('skip_autoload' => 1)); /* @var $object kDBItem */ @@ -82,7 +82,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { $ids = $event->getEventParam('ids'); @@ -107,7 +107,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); Index: core/units/mailing_lists/mailing_list_eh.php =================================================================== --- core/units/mailing_lists/mailing_list_eh.php (revision 15111) +++ core/units/mailing_lists/mailing_list_eh.php (working copy) @@ -43,7 +43,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); @@ -71,7 +71,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { $ids = $event->getEventParam('ids'); @@ -97,7 +97,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -124,7 +124,7 @@ * * @param kEvent $event */ - function OnCancelMailing(&$event) + function OnCancelMailing($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -149,7 +149,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -181,7 +181,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -199,7 +199,7 @@ * * @param kEvent $event */ - function _deleteQueue(&$event) + function _deleteQueue($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -236,7 +236,7 @@ * * @param kEvent $event */ - function OnGenerateEmailQueue(&$event) + function OnGenerateEmailQueue($event) { $id_field = $this->Application->getUnitOption($event->Prefix, 'IDField'); $table_name = $this->Application->getUnitOption($event->Prefix, 'TableName'); @@ -311,7 +311,7 @@ * * @param kEvent $event */ - function OnProcessEmailQueue(&$event) + function OnProcessEmailQueue($event) { $deliver_count = $this->_ensureDefault('MailingListSendPerStep'); if ($deliver_count === false) { Index: core/units/modules/modules_event_handler.php =================================================================== --- core/units/modules/modules_event_handler.php (revision 15111) +++ core/units/modules/modules_event_handler.php (working copy) @@ -24,7 +24,7 @@ * @param kEvent $event * @access protected */ - protected function OnItemBuild(kEvent &$event) + protected function OnItemBuild(kEvent $event) { $this->Application->SetVar($event->getPrefixSpecial(true) . '_id', $event->Special); @@ -39,7 +39,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -73,7 +73,7 @@ * * @param kEvent $event */ - function moduleAction(&$event) + function moduleAction($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -143,7 +143,7 @@ * @return void * @access protected */ - protected function OnAfterListQuery(kEvent &$event) + protected function OnAfterListQuery(kEvent $event) { parent::OnAfterListQuery($event); Index: core/units/page_revisions/page_revision_eh.php =================================================================== --- core/units/page_revisions/page_revision_eh.php (revision 15111) +++ core/units/page_revisions/page_revision_eh.php (working copy) @@ -23,7 +23,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnItemBuild' ) { return true; @@ -58,7 +58,7 @@ * @return void * @access protected */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -88,7 +88,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'current' ) { $page =& $this->Application->recallObject('st.-virtual'); @@ -132,7 +132,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -154,7 +154,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -174,7 +174,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -206,7 +206,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -230,7 +230,7 @@ * * @param kEvent $event */ - function OnGetInfo(&$event) + function OnGetInfo($event) { $event->status = kEvent::erSTOP; @@ -252,7 +252,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { $revision_id = $this->getCurrentDraftRevision($event); @@ -282,7 +282,7 @@ * * @param kEvent $event */ - function OnDiscard(&$event) + function OnDiscard($event) { $revision_id = $this->getCurrentDraftRevision($event); @@ -301,7 +301,7 @@ * * @param kEvent $event */ - function OnPublish(&$event) + function OnPublish($event) { $revision =& $this->Application->recallObject('page-revision.current'); /* @var $revision kDBItem */ @@ -321,7 +321,7 @@ * * @param kEvent $event */ - function OnDecline(&$event) + function OnDecline($event) { $revision =& $this->Application->recallObject('page-revision.current'); /* @var $revision kDBItem */ @@ -342,7 +342,7 @@ * @param kEvent $event * @return int */ - function getCurrentDraftRevision(&$event) + function getCurrentDraftRevision($event) { $where_clause = Array ( 'IsDraft = 1', @@ -363,7 +363,7 @@ * @param kEvent $event * @return int */ - function getNextAvailableRevision(&$event) + function getNextAvailableRevision($event) { $sql = 'SELECT MAX(RevisionNumber) FROM ' . $this->Application->getUnitOption($event->Prefix, 'TableName') . ' Index: core/units/permission_types/permission_type_eh.php =================================================================== --- core/units/permission_types/permission_type_eh.php (revision 15111) +++ core/units/permission_types/permission_type_eh.php (working copy) @@ -23,7 +23,7 @@ * @return void * @access protected */ - protected function OnBeforeItemDelete(kEvent &$event) + protected function OnBeforeItemDelete(kEvent $event) { parent::OnBeforeItemDelete($event); Index: core/units/permissions/permissions_event_handler.php =================================================================== --- core/units/permissions/permissions_event_handler.php (revision 15111) +++ core/units/permissions/permissions_event_handler.php (working copy) @@ -39,7 +39,7 @@ * * @param kEvent $event */ - function OnCategorySavePermissions(&$event) + function OnCategorySavePermissions($event) { $group_id = $this->Application->GetVar('current_group_id'); $category_id = $this->Application->GetVar('c_id'); @@ -106,7 +106,7 @@ * @return void * @access protected */ - protected function OnGroupSavePermissions(&$event) + protected function OnGroupSavePermissions($event) { if ( !$this->Application->CheckPermission('in-portal:user_groups.advanced:manage_permissions', 1) ) { // no permission to save permissions @@ -187,7 +187,7 @@ * @param Array $update_sql * @param Array $delete_ids */ - function UpdatePermissions(&$event, $create_sql, $update_sql, $delete_ids) + function UpdatePermissions($event, $create_sql, $update_sql, $delete_ids) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -242,7 +242,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteFromLive(kEvent &$event) + protected function OnBeforeDeleteFromLive(kEvent $event) { parent::OnBeforeDeleteFromLive($event); Index: core/units/phrases/phrases_event_handler.php =================================================================== --- core/units/phrases/phrases_event_handler.php (revision 15116) +++ core/units/phrases/phrases_event_handler.php (working copy) @@ -46,7 +46,7 @@ * @return void * @access protected */ - protected function prepareObject(&$object, kEvent &$event) + protected function prepareObject(&$object, kEvent $event) { // don't call parent if ( $event->Special == 'import' || $event->Special == 'export' ) { @@ -65,7 +65,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( !$this->Application->isAdmin && $this->Application->isDebugMode(false) && kUtil::constOn('DBG_PHRASES') ) { $allow_events = Array ('OnCreate', 'OnUpdate'); @@ -83,7 +83,7 @@ * * @param kEvent $event */ - function OnPreparePhrase(&$event) + function OnPreparePhrase($event) { $label = $this->Application->GetVar($event->getPrefixSpecial() . '_label'); @@ -129,7 +129,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -146,7 +146,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); @@ -209,7 +209,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { if ( $this->Application->GetVar($event->Prefix . '_label') ) { $object =& $event->getObject(Array ('skip_autoload' => true)); @@ -232,7 +232,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { if ( $this->Application->GetVar($event->Prefix . '_label') ) { $this->returnToOriginalTemplate($event); @@ -248,7 +248,7 @@ * @return void * @access protected */ - protected function returnToOriginalTemplate(kEvent &$event) + protected function returnToOriginalTemplate(kEvent $event) { $next_template = $this->Application->GetVar('next_template'); @@ -265,7 +265,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -299,7 +299,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -311,7 +311,7 @@ * * @param kEvent $event */ - function _phraseChanged(&$event) + function _phraseChanged($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -379,7 +379,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -420,7 +420,7 @@ * @return void * @access protected */ - protected function OnPreSaveAndChangeLanguage(kEvent &$event) + protected function OnPreSaveAndChangeLanguage(kEvent $event) { $label = $this->Application->GetVar($event->getPrefixSpecial() . '_label'); @@ -459,7 +459,7 @@ * @return void * @access protected */ - protected function OnEdit(kEvent &$event) + protected function OnEdit(kEvent $event) { parent::OnEdit($event); @@ -474,7 +474,7 @@ * @return void * @access protected */ - protected function OnExportPhrases(kEvent &$event) + protected function OnExportPhrases(kEvent $event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; Index: core/units/priorites/priority_eh.php =================================================================== --- core/units/priorites/priority_eh.php (revision 15111) +++ core/units/priorites/priority_eh.php (working copy) @@ -60,7 +60,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -159,7 +159,7 @@ * * @param kEvent $event */ - function OnPreparePriorities(&$event) + function OnPreparePriorities($event) { if ( !$this->Application->isAdminUser ) { return ; @@ -178,7 +178,7 @@ * * @param kEvent $event */ - function OnSavePriorityChanges(&$event) + function OnSavePriorityChanges($event) { if ($event->MasterEvent->status != kEvent::erSUCCESS) { // don't update priorities, when OnSave validation failed @@ -211,7 +211,7 @@ * * @param kEvent $event */ - function OnItemDelete(&$event) + function OnItemDelete($event) { // just store the prefix in which the items were deleted $del = $this->Application->RecallVar('priority_deleted' . $this->Application->GetVar('m_wid')); @@ -236,7 +236,7 @@ * * @param kEvent $event */ - function OnBeforeShutDown(&$event) + function OnBeforeShutDown($event) { $del = $this->Application->RecallVar('priority_deleted'.$this->Application->GetVar('m_wid')); $del = $del ? unserialize($del) : array(); @@ -261,7 +261,7 @@ * * @param kEvent $event */ - function OnSaveItems(&$event) + function OnSaveItems($event) { $tmp = $this->Application->RecallVar('priority_changes'.$this->Application->GetVar('m_wid')); $changes = $tmp ? unserialize($tmp) : array(); @@ -277,7 +277,7 @@ } } - function OnItemCreate(&$event) + function OnItemCreate($event) { $obj =& $event->MasterEvent->getObject(); if ($obj->GetDBField('Priority') == 0) { @@ -294,7 +294,7 @@ * * @param kEvent $event */ - function OnChangePriority(&$event) + function OnChangePriority($event) { $prefix = $this->Application->GetVar('priority_prefix'); $dummy_event = new kEvent( array('prefix'=>$prefix, 'name'=>'Dummy' ) ); @@ -364,13 +364,13 @@ * * @param kEvent $event */ - function OnRecalculatePriorities(&$event) + function OnRecalculatePriorities($event) { $priority_helper =& $this->Application->recallObject('PriorityHelper'); /* @var $priority_helper kPriorityHelper */ $prefix = $this->Application->GetVar('priority_prefix'); - $dummy_event = new kEvent( array('prefix'=>$prefix, 'name'=>'Dummy' ) ); + $dummy_event = new kEvent($prefix . ':Dummy'); list ($constrain, $joins) = $this->getConstrainInfo($event); $ids = $priority_helper->recalculatePriorities($dummy_event, $constrain, $joins); @@ -386,7 +386,7 @@ * @param kEvent $event * @return Array */ - function getConstrainInfo(&$event) + function getConstrainInfo($event) { $constrain_event = new kEvent($event->MasterEvent->getPrefixSpecial() . ':OnGetConstrainInfo'); $constrain_event->setEventParam('actual_event', $event->Name); Index: core/units/promo_block_groups/promo_block_group_eh.php =================================================================== --- core/units/promo_block_groups/promo_block_group_eh.php (revision 15111) +++ core/units/promo_block_groups/promo_block_group_eh.php (working copy) @@ -23,7 +23,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); $this->beforeItemChange($event); @@ -36,7 +36,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); $this->beforeItemChange($event); @@ -49,7 +49,7 @@ * @return void * @access private */ - private function beforeItemChange(&$event) + private function beforeItemChange($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -65,7 +65,7 @@ * @return void * @access protected */ - protected function OnBeforeItemDelete(kEvent &$event) + protected function OnBeforeItemDelete(kEvent $event) { parent::OnBeforeItemDelete($event); @@ -90,7 +90,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -107,7 +107,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { parent::OnSave($event); @@ -123,7 +123,7 @@ * @return void * @access protected */ - protected function OnMassDelete(kEvent &$event) + protected function OnMassDelete(kEvent $event) { parent::OnMassDelete($event); Index: core/units/promo_blocks/promo_block_eh.php =================================================================== --- core/units/promo_blocks/promo_block_eh.php (revision 15111) +++ core/units/promo_blocks/promo_block_eh.php (working copy) @@ -64,7 +64,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -82,7 +82,7 @@ * * @param kEvent $event */ - function OnChangePriority(&$event) + function OnChangePriority($event) { $this->Application->SetVar('priority_prefix', $event->getPrefixSpecial()); $event->CallSubEvent('priority:' . $event->Name); @@ -96,7 +96,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -133,7 +133,7 @@ * @return void * @access protected */ - protected function OnSetSticky(kEvent &$event) + protected function OnSetSticky(kEvent $event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -164,7 +164,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -178,7 +178,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -192,7 +192,7 @@ * @return void * @access protected */ - protected function _itemChanged(kEvent &$event) + protected function _itemChanged(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -215,7 +215,7 @@ * @return void * @access protected */ - protected function OnRegisterView(kEvent &$event) + protected function OnRegisterView(kEvent $event) { $this->_incrementField($event, 'NumberOfViews'); } @@ -227,7 +227,7 @@ * @return void * @access protected */ - protected function OnFollowLink(kEvent &$event) + protected function OnFollowLink(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -257,7 +257,7 @@ * @return void * @access protected */ - protected function _incrementField(kEvent &$event, $field, $is_ajax = true) + protected function _incrementField(kEvent $event, $field, $is_ajax = true) { if ( $is_ajax ) { $event->status = kEvent::erSTOP; @@ -291,7 +291,7 @@ * @return void * @access protected */ - protected function OnResetCounters(kEvent &$event) + protected function OnResetCounters(kEvent $event) { $object =& $event->getObject( Array ('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -315,7 +315,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); Index: core/units/related_searches/related_searches_event_handler.php =================================================================== --- core/units/related_searches/related_searches_event_handler.php (revision 15111) +++ core/units/related_searches/related_searches_event_handler.php (working copy) @@ -23,7 +23,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); Index: core/units/relationship/relationship_event_handler.php =================================================================== --- core/units/relationship/relationship_event_handler.php (revision 15111) +++ core/units/relationship/relationship_event_handler.php (working copy) @@ -41,7 +41,7 @@ * @return void * @access protected */ - protected function OnNew(kEvent &$event) + protected function OnNew(kEvent $event) { parent::OnNew($event); @@ -65,7 +65,7 @@ * * @param kEvent $event */ - function OnProcessSelected(&$event) + function OnProcessSelected($event) { $dst_field = $this->Application->RecallVar('dst_field'); @@ -132,7 +132,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -165,7 +165,7 @@ * @return string * @access protected */ - protected function ListPrepareQuery(kEvent &$event) + protected function ListPrepareQuery(kEvent $event) { return $this->BaseQuery($event, 'ListSQLs'); } @@ -179,7 +179,7 @@ * @return string * @access protected */ - protected function ItemPrepareQuery(kEvent &$event) + protected function ItemPrepareQuery(kEvent $event) { return $this->BaseQuery($event, 'ItemSQLs'); } @@ -191,7 +191,7 @@ * @param kEvent $event * @param string $sql_field */ - function BaseQuery(&$event, $sql_field) + function BaseQuery($event, $sql_field) { $sqls = $this->Application->getUnitOption($event->Prefix,$sql_field); $sql = isset($sqls[$event->Special]) ? $sqls[$event->Special] : $sqls['']; @@ -287,7 +287,7 @@ * * @param kEvent $event */ - function OnDeleteForeignRelations(&$event) + function OnDeleteForeignRelations($event) { $main_object =& $event->MasterEvent->getObject(); /* @var $main_object kDBItem */ Index: core/units/reviews/reviews_event_handler.php =================================================================== --- core/units/reviews/reviews_event_handler.php (revision 15126) +++ core/units/reviews/reviews_event_handler.php (working copy) @@ -23,7 +23,7 @@ * @return string * @access protected */ - protected function getMainSpecial(kEvent &$event) + protected function getMainSpecial(kEvent $event) { if ( $event->Special == 'product' && !$this->Application->isAdmin ) { // rev.product should auto-link @@ -40,7 +40,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnAddReview' || $event->Name == 'OnCreate' ) { $perm_helper =& $this->Application->recallObject('PermissionsHelper'); @@ -114,7 +114,7 @@ * @param kEvent $event * @return int */ - function _getReviewCategory(&$event) + function _getReviewCategory($event) { $items_info = $this->Application->GetVar($event->getPrefixSpecial()); @@ -160,7 +160,7 @@ * * @param kEvent $event */ - function getPermPrefix(&$event) + function getPermPrefix($event) { $main_prefix = $this->Application->GetTopmostPrefix($event->Prefix, true); // this will return LINK for l, ARTICLE for n, TOPIC for bb, PRODUCT for p @@ -175,7 +175,7 @@ * @access protected * @see OnListBuild */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -229,7 +229,7 @@ * * @param kEvent $event */ - function OnAddReview(&$event) + function OnAddReview($event) { $event->CallSubEvent('OnCreate'); } @@ -240,7 +240,7 @@ * @param kEvent $event * @return int */ - function getReviewStatus(&$event) + function getReviewStatus($event) { $parent_prefix = $this->Application->getUnitOption($event->Prefix, 'ParentPrefix'); $main_object =& $this->Application->recallObject($parent_prefix); @@ -265,7 +265,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -314,7 +314,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -335,7 +335,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -373,7 +373,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -402,7 +402,7 @@ * @param kEvent $event * @return kCatDBItem */ - function _loadMainObject(&$event) + function _loadMainObject($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -422,7 +422,7 @@ * * @param kEvent $event */ - function updateSubitemCounters(&$event) + function updateSubitemCounters($event) { if ( $event->Special == '-item' ) { // ignore Main Item Copy/Pasting and Deleting @@ -515,7 +515,7 @@ * @return void * @access protected */ - protected function OnAfterItemDelete(kEvent &$event) + protected function OnAfterItemDelete(kEvent $event) { parent::OnAfterItemDelete($event); @@ -529,7 +529,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { parent::OnCreate($event); @@ -572,7 +572,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -624,7 +624,7 @@ * @return void * @access protected */ - protected function OnSetPerPage(kEvent &$event) + protected function OnSetPerPage(kEvent $event) { parent::OnSetPerPage($event); Index: core/units/scheduled_tasks/scheduled_task_eh.php =================================================================== --- core/units/scheduled_tasks/scheduled_task_eh.php (revision 15111) +++ core/units/scheduled_tasks/scheduled_task_eh.php (working copy) @@ -40,7 +40,7 @@ * * @param kEvent $event */ - function OnRefresh(&$event) + function OnRefresh($event) { $scheduled_tasks_from_cache = $this->Application->EventManager->getScheduledTasks(true); @@ -95,7 +95,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { if ( $this->Application->isDebugMode() ) { @@ -122,7 +122,7 @@ * * @param kEvent $event */ - function OnMassCancel(&$event) + function OnMassCancel($event) { $ids = $this->StoreSelectedIDs($event); @@ -149,7 +149,7 @@ * * @param kEvent $event */ - function OnRun(&$event) + function OnRun($event) { $ids = $this->StoreSelectedIDs($event); Index: core/units/sections/site_config_eh.php =================================================================== --- core/units/sections/site_config_eh.php (revision 15111) +++ core/units/sections/site_config_eh.php (working copy) @@ -28,7 +28,7 @@ * * @param kEvent $event */ - function OnApplySiteConfigChanges(&$event) + function OnApplySiteConfigChanges($event) { if ( $event->MasterEvent->getEventParam('skip_site_config') ) { return ; Index: core/units/selectors/selectors_event_handler.php =================================================================== --- core/units/selectors/selectors_event_handler.php (revision 15111) +++ core/units/selectors/selectors_event_handler.php (working copy) @@ -46,7 +46,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(kEvent &$event) + protected function OnBeforeClone(kEvent $event) { parent::OnBeforeClone($event); @@ -101,7 +101,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -126,7 +126,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -140,7 +140,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -154,7 +154,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -168,7 +168,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -182,7 +182,7 @@ * @return string * @access protected */ - protected function getMainSpecial(kEvent &$event) + protected function getMainSpecial(kEvent $event) { return ''; } @@ -192,7 +192,7 @@ * * @param kEvent $event */ - function OnOpenStyleEditor(&$event) + function OnOpenStyleEditor($event) { $this->SaveChanges($event); $event->redirect = false; @@ -203,7 +203,7 @@ * * @param kEvent $event */ - function SaveChanges(&$event) + function SaveChanges($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -236,7 +236,7 @@ * * @param kEvent $event */ - function OnSaveStyle(&$event) + function OnSaveStyle($event) { $this->SaveChanges($event); @@ -253,7 +253,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -278,7 +278,7 @@ * * @param kEvent $event */ - function SerializeSelectorData(&$event) + function SerializeSelectorData($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -302,7 +302,7 @@ * * @param kEvent $event */ - function UnserializeSelectorData(&$event) + function UnserializeSelectorData($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -327,7 +327,7 @@ * * @param kEvent $event */ - function OnPrepareBaseStyles(&$event) + function OnPrepareBaseStyles($event) { $object =& $event->getObject(); @@ -346,7 +346,7 @@ * @param Array $selector_data * @return Array */ - function RemoveParentProperties(&$event, $selector_data) + function RemoveParentProperties($event, $selector_data) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -389,7 +389,7 @@ * @param Array $selector_data * @return Array */ - function AddParentProperties(&$event, $selector_data) + function AddParentProperties($event, $selector_data) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -419,7 +419,7 @@ * * @param kEvent $event */ - function OnResetToBase(&$event) + function OnResetToBase($event) { $object =& $event->getObject(); /* @var $object SelectorsItem */ @@ -436,7 +436,7 @@ * * @param kEvent $event */ - function OnMassResetToBase(&$event) + function OnMassResetToBase($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object SelectorsItem */ Index: core/units/site_domains/site_domain_eh.php =================================================================== --- core/units/site_domains/site_domain_eh.php (revision 15111) +++ core/units/site_domains/site_domain_eh.php (working copy) @@ -23,7 +23,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnItemBuild' ) { // check permission without using $event->getSection(), @@ -41,7 +41,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'current' ) { if ( $this->Application->isAdmin ) { @@ -108,7 +108,7 @@ * @return void * @access protected */ - protected function LoadItem(kEvent &$event) + protected function LoadItem(kEvent $event) { if ( $this->Application->isAdmin ) { // don't load domain data from cache @@ -151,7 +151,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -194,7 +194,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { parent::OnSave($event); @@ -226,7 +226,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -240,7 +240,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -254,7 +254,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -266,7 +266,7 @@ * * @param kEvent $event */ - function _itemChanged(&$event) + function _itemChanged($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -282,7 +282,7 @@ * * @param kEvent $event */ - function _setRequired(&$event) + function _setRequired($event) { $object =& $event->getObject(); /* @var $object kDBItem */ Index: core/units/skins/skin_eh.php =================================================================== --- core/units/skins/skin_eh.php (revision 15111) +++ core/units/skins/skin_eh.php (working copy) @@ -41,7 +41,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { if ( $event->Special == 'primary' ) { return Array ('IsPrimary' => 1); @@ -55,7 +55,7 @@ * * @param kEvent $event */ - function OnSetPrimary(&$event) + function OnSetPrimary($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -94,7 +94,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(kEvent &$event) + protected function OnBeforeClone(kEvent $event) { parent::OnBeforeClone($event); @@ -111,7 +111,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -133,7 +133,7 @@ * @return void * @access protected */ - protected function OnCompileStylesheet(&$event) + protected function OnCompileStylesheet($event) { $object =& $event->getObject( Array ('skip_autoload' => true) ); /* @var $object kDBItem */ Index: core/units/spam_reports/spam_report_eh.php =================================================================== --- core/units/spam_reports/spam_report_eh.php (revision 15111) +++ core/units/spam_reports/spam_report_eh.php (working copy) @@ -40,7 +40,7 @@ * * @param kEvent $event */ -// function CheckPermission(&$event) +// function CheckPermission($event) // { // if ( $event->Name == 'OnNewReport' ) { // $perm_helper =& $this->Application->recallObject('PermissionsHelper'); @@ -59,7 +59,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -84,7 +84,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -108,7 +108,7 @@ * * @param kEvent $event */ - function OnNewReport(&$event) + function OnNewReport($event) { $ajax_form_helper =& $this->Application->recallObject('AjaxFormHelper'); /* @var $ajax_form_helper AjaxFormHelper */ @@ -121,7 +121,7 @@ * * @param kEvent $event */ - function OnDeleteAssocItem(&$event) + function OnDeleteAssocItem($event) { $temp_handlers = Array (); $ids = $this->StoreSelectedIDs($event); Index: core/units/statistics/statistics_event_handler.php =================================================================== --- core/units/statistics/statistics_event_handler.php (revision 15111) +++ core/units/statistics/statistics_event_handler.php (working copy) @@ -24,7 +24,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); Index: core/units/stylesheets/stylesheets_event_handler.php =================================================================== --- core/units/stylesheets/stylesheets_event_handler.php (revision 15111) +++ core/units/stylesheets/stylesheets_event_handler.php (working copy) @@ -23,7 +23,7 @@ * @return void * @access protected */ - protected function OnCompileStylesheet(&$event) + protected function OnCompileStylesheet($event) { $object =& $event->getObject( Array ('skip_autoload' => true) ); /* @var $object StylesheetsItem */ Index: core/units/theme_files/theme_file_eh.php =================================================================== --- core/units/theme_files/theme_file_eh.php (revision 15111) +++ core/units/theme_files/theme_file_eh.php (working copy) @@ -43,7 +43,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnLoadBlock' || $event->Name == 'OnSaveBlock' ) { return $this->Application->isAdminUser; @@ -59,7 +59,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -83,7 +83,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -105,7 +105,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -154,7 +154,7 @@ * * @param kEvent $event */ - function OnLoadBlock(&$event) + function OnLoadBlock($event) { parent::OnNew($event); @@ -177,7 +177,7 @@ * * @param kEvent $event */ - function OnSaveBlock(&$event) + function OnSaveBlock($event) { $object =& $event->getObject( Array('skip_autoload' => true) ); /* @var $object kDBItem */ @@ -211,7 +211,7 @@ * * @param kEvent $event */ - function OnSaveLayout(&$event) + function OnSaveLayout($event) { $event->status = kEvent::erSTOP; if (($this->Application->GetVar('ajax') != 'yes') || (EDITING_MODE != EDITING_MODE_DESIGN)) { Index: core/units/themes/themes_eh.php =================================================================== --- core/units/themes/themes_eh.php (revision 15111) +++ core/units/themes/themes_eh.php (working copy) @@ -41,7 +41,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnItemBuild' ) { // check permission without using $event->getSection(), @@ -57,7 +57,7 @@ * * @param kEvent $event */ - function OnSetPrimary(&$event) + function OnSetPrimary($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -69,8 +69,7 @@ $id = array_shift($ids); $this->setPrimary($id); - $rebuild_event = new kEvent('adm:OnRebuildThemes'); - $this->Application->HandleEvent($rebuild_event); + $this->Application->HandleEvent(new kEvent('adm:OnRebuildThemes')); } $this->clearSelectedIDs($event); @@ -99,7 +98,7 @@ * @return void * @access protected */ - protected function OnAfterCopyToLive(kEvent &$event) + protected function OnAfterCopyToLive(kEvent $event) { parent::OnAfterCopyToLive($event); @@ -120,7 +119,7 @@ * @return void * @access protected */ - protected function OnSave(kEvent &$event) + protected function OnSave(kEvent $event) { parent::OnSave($event); @@ -139,8 +138,7 @@ $enabled_themes = $this->Conn->GetOne($sql); if ( $enabled_themes ) { - $rebuild_event = new kEvent('adm:OnRebuildThemes'); - $this->Application->HandleEvent($rebuild_event); + $this->Application->HandleEvent(new kEvent('adm:OnRebuildThemes')); } } @@ -149,7 +147,7 @@ * * @param kEvent $event */ - function OnChangeTheme(&$event) + function OnChangeTheme($event) { if ($this->Application->isAdminUser) { // for structure theme dropdown @@ -172,7 +170,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); Index: core/units/thesaurus/thesaurus_eh.php =================================================================== --- core/units/thesaurus/thesaurus_eh.php (revision 15111) +++ core/units/thesaurus/thesaurus_eh.php (working copy) @@ -24,7 +24,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); Index: core/units/translator/translator_event_handler.php =================================================================== --- core/units/translator/translator_event_handler.php (revision 15111) +++ core/units/translator/translator_event_handler.php (working copy) @@ -42,7 +42,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { list($prefix, ) = $this->getPrefixAndField($event); @@ -58,7 +58,7 @@ * * @param kEvent $event */ - function getPrefixAndField(&$event) + function getPrefixAndField($event) { $field = $this->Application->GetVar($event->getPrefixSpecial(true).'_field'); @@ -78,7 +78,7 @@ * @return void * @access protected */ - protected function OnLoad(&$event) + protected function OnLoad($event) { list($obj_prefix, $field) = $this->getPrefixAndField($event); @@ -122,7 +122,7 @@ * @return void * @access protected */ - protected function OnSaveAndClose(&$event) + protected function OnSaveAndClose($event) { $event->CallSubEvent('OnPreSave'); @@ -137,7 +137,7 @@ * @return void * @access protected */ - protected function OnPreSave(kEvent &$event) + protected function OnPreSave(kEvent $event) { $translator =& $event->getObject(); /* @var $translator kDBItem */ @@ -165,7 +165,7 @@ * @return void * @access protected */ - protected function OnChangeLanguage(&$event) + protected function OnChangeLanguage($event) { $event->CallSubEvent('OnPreSave'); Index: core/units/user_groups/user_groups_eh.php =================================================================== --- core/units/user_groups/user_groups_eh.php (revision 15111) +++ core/units/user_groups/user_groups_eh.php (working copy) @@ -21,7 +21,7 @@ * * @param kEvent $event */ - function OnProcessSelected(&$event) + function OnProcessSelected($event) { if ($event->Prefix == 'u-ug') { $new_groups = $this->Application->GetVar('g'); @@ -92,7 +92,7 @@ * * @param kEvent $event */ - function OnSetPrimary(&$event) + function OnSetPrimary($event) { $ids = $this->StoreSelectedIDs($event); @@ -115,7 +115,7 @@ * @return void * @access protected */ - protected function customProcessing(kEvent &$event, $type) + protected function customProcessing(kEvent $event, $type) { if ( $event->Name == 'OnMassDelete' && $type == 'before' ) { $ids = $event->getEventParam('ids'); Index: core/units/user_profile/user_profile_eh.php =================================================================== --- core/units/user_profile/user_profile_eh.php (revision 15111) +++ core/units/user_profile/user_profile_eh.php (working copy) @@ -42,7 +42,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); list ($user_id, $field_values) = each($items_info); Index: core/units/users/users_event_handler.php =================================================================== --- core/units/users/users_event_handler.php (revision 15111) +++ core/units/users/users_event_handler.php (working copy) @@ -81,7 +81,7 @@ * @param kEvent $event * @access protected */ - protected function OnItemBuild(kEvent &$event) + protected function OnItemBuild(kEvent $event) { parent::OnItemBuild($event); @@ -101,7 +101,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -148,7 +148,7 @@ * @return bool * @access public */ - public function CheckPermission(kEvent &$event) + public function CheckPermission(kEvent $event) { if ( $event->Name == 'OnLogin' || $event->Name == 'OnLoginAjax' || $event->Name == 'OnLogout' ) { // permission is checked in OnLogin event directly @@ -221,7 +221,7 @@ * * @param kEvent $event */ - function OnSessionExpire(&$event) + function OnSessionExpire($event) { $this->Application->resetCounters('UserSessions'); @@ -262,7 +262,7 @@ * * @param kEvent $event */ - function OnDeleteExpiredSessions(&$event) + function OnDeleteExpiredSessions($event) { if (defined('IS_INSTALL') && IS_INSTALL) { return ; @@ -278,7 +278,7 @@ * @return void * @access protected */ - protected function OnLogin(&$event) + protected function OnLogin($event) { $object =& $event->getObject( Array ('form_name' => 'login') ); /* @var $object kDBItem */ @@ -314,7 +314,7 @@ * @return void * @access protected */ - protected function OnLoginAjax(&$event) + protected function OnLoginAjax($event) { $ajax_form_helper =& $this->Application->recallObject('AjaxFormHelper'); /* @var $ajax_form_helper AjaxFormHelper */ @@ -327,7 +327,7 @@ * * @param kEvent $event */ - function OnAutoLoginUser(&$event) + function OnAutoLoginUser($event) { $remember_login_cookie = $this->Application->GetVar('remember_login'); @@ -346,7 +346,7 @@ * * @param kEvent $event */ - function OnInpLogin(&$event) + function OnInpLogin($event) { $sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), Array ('InPortalSyncronize')); /* @var $sync_manager UsersSyncronizeManager */ @@ -364,7 +364,7 @@ * * @param kEvent $event */ - function OnInpLogout(&$event) + function OnInpLogout($event) { $sync_manager =& $this->Application->recallObject('UsersSyncronizeManager', null, Array(), Array ('InPortalSyncronize')); /* @var $sync_manager UsersSyncronizeManager */ @@ -379,7 +379,7 @@ * @return void * @access protected */ - protected function OnLogout(&$event) + protected function OnLogout($event) { $user_helper =& $this->Application->recallObject('UserHelper'); /* @var $user_helper UserHelper */ @@ -395,7 +395,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(kEvent &$event) + protected function OnAfterItemCreate(kEvent $event) { parent::OnAfterItemCreate($event); @@ -411,7 +411,7 @@ * @return void * @access protected */ - protected function OnCreate(kEvent &$event) + protected function OnCreate(kEvent $event) { if ( $this->Application->isAdmin ) { parent::OnCreate($event); @@ -460,7 +460,7 @@ * @return void * @access protected */ - protected function OnRegisterAjax(kEvent &$event) + protected function OnRegisterAjax(kEvent $event) { $ajax_form_helper =& $this->Application->recallObject('AjaxFormHelper'); /* @var $ajax_form_helper AjaxFormHelper */ @@ -490,7 +490,7 @@ * * @param kEvent $event */ - function autoLoginUser(&$event) + function autoLoginUser($event) { $object =& $event->getObject(); /* @var $object UsersItem */ @@ -515,7 +515,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(kEvent &$event) + protected function OnBeforeItemCreate(kEvent $event) { parent::OnBeforeItemCreate($event); @@ -591,7 +591,7 @@ * * @param kEvent $event */ - protected function assignToPrimaryGroup(&$event) + protected function assignToPrimaryGroup($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -621,7 +621,7 @@ * @return void * @access protected */ - protected function OnAfterItemValidate(kEvent &$event) + protected function OnAfterItemValidate(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -638,7 +638,7 @@ * * @param kEvent $event */ - function OnRecommend(&$event) + function OnRecommend($event) { $object =& $event->getObject( Array ('form_name' => 'recommend') ); /* @var $object kDBItem */ @@ -676,7 +676,7 @@ * * @param kEvent $event */ - function OnUpdateAddress(&$event) + function OnUpdateAddress($event) { $object =& $event->getObject(Array ('skip_autoload' => true)); /* @var $object kDBItem */ @@ -708,7 +708,7 @@ * * @param kEvent $event */ - function OnSubscribeQuery(&$event) + function OnSubscribeQuery($event) { $object =& $event->getObject( Array ('form_name' => 'subscription') ); /* @var $object UsersItem */ @@ -741,7 +741,7 @@ * * @param kEvent $event */ - function OnSubscribeUser(&$event) + function OnSubscribeUser($event) { $object =& $event->getObject( Array ('form_name' => 'subscription') ); /* @var $object UsersItem */ @@ -842,7 +842,7 @@ * @param kEvent $event * @return void */ - function OnForgotPassword(&$event) + function OnForgotPassword($event) { $object =& $event->getObject( Array ('form_name' => 'forgot_password') ); /* @var $object kDBItem */ @@ -911,7 +911,7 @@ * @return void * @access protected */ - protected function OnUpdate(kEvent &$event) + protected function OnUpdate(kEvent $event) { parent::OnUpdate($event); @@ -927,7 +927,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(kEvent &$event) + protected function OnBeforeItemUpdate(kEvent $event) { parent::OnBeforeItemUpdate($event); @@ -965,7 +965,7 @@ * * @param kEvent $event */ - function beforeItemChanged(&$event) + function beforeItemChanged($event) { $object =& $event->getObject(); /* @var $object UsersItem */ @@ -999,7 +999,7 @@ * @param kEvent $event * @param bool $for_registration */ - function setNextTemplate(&$event, $for_registration = false) + function setNextTemplate($event, $for_registration = false) { $event->SetRedirectParam('opener', 's'); @@ -1034,7 +1034,7 @@ * * @param kEvent $event */ - function OnCheckExpiredMembership(&$event) + function OnCheckExpiredMembership($event) { // send pre-expiration reminders: begin $pre_expiration = adodb_mktime() + $this->Application->ConfigValue('User_MembershipExpirationReminder') * 3600 * 24; @@ -1086,7 +1086,7 @@ * @return void * @access protected */ - protected function OnRefreshForm(&$event) + protected function OnRefreshForm($event) { $event->redirect = false; $item_info = $this->Application->GetVar( $event->getPrefixSpecial(true) ); @@ -1105,7 +1105,7 @@ * * @param kEvent $event */ - function OnSetPersistantVariable(&$event) + function OnSetPersistantVariable($event) { $field = $this->Application->GetVar('field'); $value = $this->Application->GetVar('value'); @@ -1124,7 +1124,7 @@ * @return int * @access public */ - public function getPassedID(kEvent &$event) + public function getPassedID(kEvent $event) { switch ($event->Special) { case 'ord': @@ -1170,7 +1170,7 @@ * * @param kEvent $event */ - function OnUpdateRootPassword(&$event) + function OnUpdateRootPassword($event) { return $this->OnUpdatePassword($event); } @@ -1182,7 +1182,7 @@ * @return void * @access protected */ - protected function OnUpdatePassword(&$event) + protected function OnUpdatePassword($event) { $items_info = $this->Application->GetVar($event->getPrefixSpecial(true)); if ( !$items_info ) { @@ -1262,7 +1262,7 @@ * @return void * @access protected */ - protected function OnMassResetSettings(&$event) + protected function OnMassResetSettings($event) { if ( $this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1) ) { $event->status = kEvent::erFAIL; @@ -1296,7 +1296,7 @@ * @return bool * @access protected */ - protected function checkItemStatus(kEvent &$event) + protected function checkItemStatus(kEvent $event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1317,7 +1317,7 @@ * @return void * @access protected */ - protected function OnAfterItemUpdate(kEvent &$event) + protected function OnAfterItemUpdate(kEvent $event) { parent::OnAfterItemUpdate($event); @@ -1342,7 +1342,7 @@ * * @param kEvent $event */ - protected function afterItemChanged(&$event) + protected function afterItemChanged($event) { $this->saveUserImages($event); @@ -1375,7 +1375,7 @@ * @return void * @access protected */ - protected function OnBeforeDeleteFromLive(kEvent &$event) + protected function OnBeforeDeleteFromLive(kEvent $event) { parent::OnBeforeDeleteFromLive($event); @@ -1395,7 +1395,7 @@ * @return void * @access protected */ - protected function OnAfterCopyToLive(kEvent &$event) + protected function OnAfterCopyToLive(kEvent $event) { parent::OnAfterCopyToLive($event); @@ -1485,7 +1485,7 @@ * @return void * @access protected */ - protected function sendEmailChangeEvent(kEvent &$event) + protected function sendEmailChangeEvent(kEvent $event) { $object =& $event->getObject(); /* @var $object UsersItem */ @@ -1536,7 +1536,7 @@ * @return void * @access protected */ - protected function OnAfterConfigRead(kEvent &$event) + protected function OnAfterConfigRead(kEvent $event) { parent::OnAfterConfigRead($event); @@ -1607,7 +1607,7 @@ * * @param kEvent $event */ - function OnMassCloneUsers(&$event) + function OnMassCloneUsers($event) { if ($this->Application->CheckPermission('SYSTEM_ACCESS.READONLY', 1)) { $event->status = kEvent::erFAIL; @@ -1629,7 +1629,7 @@ * @return void * @access protected */ - protected function OnBeforeClone(kEvent &$event) + protected function OnBeforeClone(kEvent $event) { parent::OnBeforeClone($event); @@ -1648,7 +1648,7 @@ * * @param kEvent $event */ - function OnSaveSelected(&$event) + function OnSaveSelected($event) { $this->StoreSelectedIDs($event); @@ -1661,7 +1661,7 @@ * * @param kEvent $event */ - function OnProcessSelected(&$event) + function OnProcessSelected($event) { $event->SetRedirectParam('opener', 'u'); $user_ids = $this->getSelectedIDs($event, true); @@ -1712,7 +1712,7 @@ * @return void * @access protected */ - protected function OnAfterItemLoad(kEvent &$event) + protected function OnAfterItemLoad(kEvent $event) { parent::OnAfterItemLoad($event); @@ -1754,7 +1754,7 @@ * * @param kEvent $event */ - function saveUserImages(&$event) + function saveUserImages($event) { if (!$this->Application->isAdmin) { $image_helper =& $this->Application->recallObject('ImageHelper'); @@ -1775,7 +1775,7 @@ * @return void * @access protected */ - protected function OnPreCreate(kEvent &$event) + protected function OnPreCreate(kEvent $event) { parent::OnPreCreate($event); @@ -1808,7 +1808,7 @@ * * @param kEvent $event */ - function _makePasswordRequired(&$event) + function _makePasswordRequired($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1824,7 +1824,7 @@ * @return void * @access protected */ - protected function LoadItem(kEvent &$event) + protected function LoadItem(kEvent $event) { $id = $this->getPassedID($event); @@ -1846,7 +1846,7 @@ * * @param kEvent $event */ - function OnAfterLogin(&$event) + function OnAfterLogin($event) { } @@ -1856,7 +1856,7 @@ * * @param kEvent $event */ - function OnBeforeLogout(&$event) + function OnBeforeLogout($event) { } @@ -1866,7 +1866,7 @@ * * @param kEvent $event */ - function OnGeneratePassword(&$event) + function OnGeneratePassword($event) { $event->status = kEvent::erSTOP; @@ -1880,7 +1880,7 @@ * * @param kEvent $event */ - function OnResetLostPassword(&$event) + function OnResetLostPassword($event) { $object =& $event->getObject(); /* @var $object kDBItem */ @@ -1907,7 +1907,7 @@ * @return void * @access protected */ - protected function OnResetRootPassword(&$event) + protected function OnResetRootPassword($event) { $password_formatter =& $this->Application->recallObject('kPasswordFormatter'); /* @var $password_formatter kPasswordFormatter */ @@ -1929,7 +1929,7 @@ * @return void * @access protected */ - protected function OnLoginAs(kEvent &$event) + protected function OnLoginAs(kEvent $event) { $user_helper =& $this->Application->recallObject('UserHelper'); /* @var $user_helper UserHelper */ Index: core/units/visits/visits_event_handler.php =================================================================== --- core/units/visits/visits_event_handler.php (revision 15111) +++ core/units/visits/visits_event_handler.php (working copy) @@ -42,7 +42,7 @@ * @return void * @access protected */ - protected function OnRegisterVisit(&$event) + protected function OnRegisterVisit($event) { if ( $this->Application->isAdmin || !$this->Application->ConfigValue('UseVisitorTracking') || $this->Application->RecallVar('visit_id') ) { // admin logins are not registered in visits list @@ -71,7 +71,7 @@ * @access protected * @see kDBEventHandler::OnListBuild() */ - protected function SetCustomQuery(kEvent &$event) + protected function SetCustomQuery(kEvent $event) { parent::SetCustomQuery($event); @@ -107,7 +107,7 @@ * @return void * @access protected */ - protected function prepareObject(&$object, kEvent &$event) + protected function prepareObject(&$object, kEvent $event) { $types = $event->getEventParam('types'); @@ -129,7 +129,7 @@ * * @param kEvent $event */ - function OnUserLogin(&$event) + function OnUserLogin($event) { if ($event->MasterEvent->status == kEvent::erSUCCESS) { $user_id = $this->Application->RecallVar('user_id'); Index: tools/run_event.php =================================================================== --- tools/run_event.php (revision 15111) +++ tools/run_event.php (working copy) @@ -36,7 +36,7 @@ $application->Init(); $application->StoreVar('user_id', USER_ROOT, true); -$application->HandleEvent($ev, $argv[1]); // event name in form "prefix[.special]:event_name" +$application->HandleEvent(new kEvent($argv[1])); // event name in form "prefix[.special]:event_name" $application->Done();